gridview - Android Lazy loading of images with Grid view ( Without using any libraries ) -



gridview - Android Lazy loading of images with Grid view ( Without using any libraries ) -

i need download images server , cache efficiently , need display in grid view. don't want utilize libraries.

can 1 help me. new android.

thanks in advance, deepak

use project , add together 4 files project i.e. https://github.com/thest1/lazylist/tree/master/src/com/fedorvlasov/lazylist

you don't need library. work standalone.

public class lazyadapter extends baseadapter { private activity activity; private string[] data; private static layoutinflater inflater=null; **public imageloader imageloader;** public lazyadapter(activity a, string[] d) { activity = a; data=d; inflater = (layoutinflater)activity.getsystemservice(context.layout_inflater_service); **imageloader=new imageloader(activity.getapplicationcontext());** } public int getcount() { homecoming data.length; } public object getitem(int position) { homecoming position; } public long getitemid(int position) { homecoming position; } public view getview(int position, view convertview, viewgroup parent) { view vi=convertview; if(convertview==null) vi = inflater.inflate(r.layout.item, null); textview text=(textview)vi.findviewbyid(r.id.text);; imageview image=(imageview)vi.findviewbyid(r.id.image); text.settext("item "+position); **imageloader.displayimage(data[position], image);** homecoming vi; } }

check bold strings. in custom lazyadapter shows set image within adapter. adapter set gridview.

android gridview lazy-loading

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -