android - Creating Multi-Column Layout with ArrayAdapter -
android - Creating Multi-Column Layout with ArrayAdapter -
i've been trying prepare problem while , have exhausted different google searches think of. i'm beginner android, understand of fundamentals (i think). anyways, i'm trying display list of info in multi-column layout spreadsheet style. i'm using listview because need users able click on row more detailed @ info since much can fit in row. have working using simpleadapter, since amount of info can large, 500 entries, wanted alter on lazy loader scheme users don't have stare @ black screen 20 seconds while loads. think can manage lazy loader part, can't figure out how switch on multi-columned format simpleadapter arrayadapter lazy loader examples use.
here's illustration of simpleadapter code:
simpleadapter adapter = new simpleadapter(this, fillmaps, r.layout.grid_item, from, to);
fillmaps list of hashmaps inserted. 'grid_item' layout entries inserted into. 'from' array of column names (alternatively keys in hashmap) used. 'to' array of textview items filled in 'grid_item'. thought how convert arrayadapter? or how lazy load simpleadapter?
thanks in advance!
to solve issue others, here did working perfectly:
created own class called entry contains strings rows created custom adapter extends arrayadapter. constructor pass arraylist of type entry. create viewholder improve ui efficiency inflate row layout xml added listviewto lazy loading working:
added method in custom adapter append new arraylist of entry objects arraylist have in adapter created onscrolllistener , debugging test found if top visible item plus remaining entries equalled total entries, scrolled way bottom once bottom detected, phone call fetch method retrieve 30 entries, add together these entries using add together method created, , utilize notifydatasetchanged() method arrayadapter display newly loaded items android android-arrayadapter simpleadapter
Comments
Post a Comment