I have many images on some of my activities, and all of them are connected to remote servers. The problem every time I go to one of these activities in which images break away from the remote. All images should be loaded first or else you will get a black blank screen. Sometimes it takes around 1-5 minutes to load, and sometimes even closes the device, can I fix this issue anyway? Some people suggest using me threads, but I really do not know how somebody can give me an example, I really appreciate it very much.
Here's the code I'm using:
ImageViewimgView = (ImageView) findViewById (R.id.image01); Drawable drawable = LoadImageFromWebOperations ("http://forum.roda.hr/images/customavatars/avatar10164_2.gif"); ImgView.setBackgroundDrawable (drawable); Private Dry Load Load ImageWebWeb Operation (string URL) {try} {InputStream = (InputStream) is the new URL (.org) .getContent; Drawable d = Drawable.createFromStream (is, "src name"); Return D; } Hold (exception e) {System.out.println ("exc =" + e); Return tap; }} I am trying to understand it, please help me, really matters a lot for me thanks in advance!
I recommend the DroidFu library for this. There is a webizable widget that will be able to load images from a remote source.
Comments
Post a Comment