Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error java.lang.NullPointerException #80

Open
Hamamelis opened this issue Apr 6, 2014 · 1 comment
Open

Error java.lang.NullPointerException #80

Hamamelis opened this issue Apr 6, 2014 · 1 comment

Comments

@Hamamelis
Copy link

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,

@sirmagid
Copy link

yes is not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants