android - Getting an image from a URL -
i pull articles server in form of json objects, image related article attribute of objects in form of url. url saved locally, along other data, in database in device.
now, in order send data ui, want use cursoradapter. question this:
is considered bad practice if set imageview url in inherited bindview method , how that?
edit: sake of clarity, should mention json objects parsed, , relevant data pulled strings stored in local database.
is considered bad practice if set imageview url in inherited bindview method
directly? yes, cause network i/o done on main application thread, freezes ui while i/o going on. instead, use 1 of number of image loading libraries handle asynchronously, picasso.
(btw, not quite sure why/how shoving json data implements cursor
-- may better off putting pojos in array , using arrayadapter
, or creating custom subclass of baseadapter
uses parsed json more directly).
Comments
Post a Comment