[android-developers] Re: jsonarray as listview source

2009-10-03 Thread vorcigernix
Thank you..finally found some way to go, perhaps not best one, but working :) On Oct 1, 3:09 am, Streets Of Boston flyingdutc...@gmail.com wrote: I think you can't use the '[ ]' operator on the JSONArray (if valArray2 is a JSONArray). [ ] only works in regular arrays. Look at the

[android-developers] Re: jsonarray as listview source

2009-09-30 Thread Streets Of Boston
Implement your subclass of BaseAdapter (e.g. JSONArrayAdapter). Implement/override the getCount(), getItem(int position), etc. to make your BaseAdapter a proper list-adapter around your jsonarray. Implement the getView method; it provides the 'position' and 'contentView' parameters. - Use

[android-developers] Re: jsonarray as listview source

2009-09-30 Thread vorcigernix
Thanks. This moved my understanding of whole BaseAdapter (which is not data adapter at all). Now I am frozen on some casting unknown to me (probably). I created code: public View getView(int position, View convertView, ViewGroup parent) { // A ViewHolder keeps references to

[android-developers] Re: jsonarray as listview source

2009-09-30 Thread Streets Of Boston
I think you can't use the '[ ]' operator on the JSONArray (if valArray2 is a JSONArray). [ ] only works in regular arrays. Look at the JSONArray class and see what method is implemented in that class to return an JSON element at position 'x'. And you have to make sure that the value

[android-developers] Re: jsonarray as listview source

2009-09-29 Thread vorcigernix
Ok, I don't get a BaseAdapter logic, I assume because I am not used to java. I found tons of examples on net (mostly for drawing pictures etc) but it make no sense to me. For example, list4 from sdk do something similar, but...where are they binding data? I see where data is set to custom class,

[android-developers] Re: jsonarray as listview source

2009-09-28 Thread Mark Murphy
vorcigernix wrote: Hello, I made my application from various examples and sources, so now I have filled jsonarray and prepared listview (with custom rows formatting). Now I need to replace ListAdapter myAdapter =(new ArrayAdapterString (this,R.layout.rowlayout, R.id.TextView01, values));