How to display a two column ListView in Android?

Posted by Josemalive on Stack Overflow See other posts from Stack Overflow or by Josemalive
Published on 2010-03-12T13:20:20Z Indexed on 2010/03/13 6:25 UTC
Read the original article Hit count: 403

Hi,

I have an android application that shows a grid view that shows:

1

2

3

4

GridView gridview=(GridView)findViewById(R.id.GridView_test);
DataBaseHelper dbhelper=new DataBaseHelper(this);
ArrayList<String> test=new ArrayList<String>(5);
backlinksadapter.add("1");
backlinksadapter.add("2");
backlinksadapter.add("3");
backlinksadapter.add("4");
ArrayAdapter mAdapter=new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, test);
gridview.setAdapter(mAdapter);

By the moment is working, but i would like to show foreach line of the grid, 2 columns with the values of a 2 dimensional array (something like the GridView in ASP.Net - as datasource -).

I would like to show:

1 | Person 1

2 | Person 2

3 | Person 3

4 | Person 4

Any idea?

© Stack Overflow or respective owner

Related posts about android

Related posts about android-sdk