Skip to content

Error java.lang.NullPointerException #80

Open
@Hamamelis

Description

@Hamamelis

I need load an image from URL into Android Application.

Next I created a sample android project which would invoke a .NET web service

    while (reader.Read())
    {
        result.Append(reader["Pic"].ToString() + "<b><font size=600 face=sans-serif color=#243c45>"
            + Convert.ToDateTime(reader["PicDate"]).ToString("dd/MM/yyyy") + "</font></b><br />" 
            + reader["PicTitle"].ToString() + "<br /><a href=http://www.xxxxxxx.com/?ID=" 
            + reader["PicID"].ToString() + ">http://www.xxxxxxx.com/?ID=" + reader["PicID"].ToString() + "</a><br /><br /><br />");
    }

And I tried the output in smartphone.

All values ​​taken from the database via .NET web service are published correctly in android application and in smartphone only the value of

reader["Pic"].ToString()

show the link of the image and not the image:

https://lh6.googleusercontent.com/........

I use in application:

 SoapPrimitive response = (SoapPrimitive)envelope.getResponse();
 textView.setText(Html.fromHtml(response.toString()));
 textView.setMovementMethod(LinkMovementMethod.getInstance());

I tried this lib on this link https://github.com/koush/UrlImageViewHelper

    try {
        httpTransport.call(SOAP_ACTION, envelope);

        SoapPrimitive response = (SoapPrimitive) envelope.getResponse();
        UrlImageViewHelper.setUrlDrawable(imagepic, "http://www.myurl/images/logo.gif");

        textView.setText(Html.fromHtml(response.toString()));
        textView.setMovementMethod(LinkMovementMethod.getInstance());               

    } catch (Exception exception) {
        textView.setText(exception.toString());
    }

But I've this error:

java.lang.NullPointerException

What shall I do?

Thanks,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions