android - How to force my GridView adapter to reload? -


i'm android beginner starting fragments. problem following. has fragment used show custom listview (it extended sherlocklistfragment). populated listview data server. action of retrieveing data of server executed in thread , had handler manage responses. in handler (inside fragment) recovered data adapter , reloaded adapter ((myadapter) fragment.getlistadapter()).datachange(); . well, wanted convert list in custom grid cause think it's better app. so, fragment doesn't extends sherlocklistfragment, basefragment. don't have listview anymore, can't not use "getlistadapter.datachange()". know correct way this? in advance.

make adapter gridview extends baseadapter, or use adapter extends baseadapter.

then call notifydatasetchanged on adapter when contents of collection has changed.

small example of adapter , grid


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -