I have to view the data of a SQLite database in a table, now the problem is that all the gridView sample that I have seen are implemented with a single array that defines all data of the table
public class GridViewDemo extends Activity implements
AdapterView.OnItemClickListener {
TextView selection;
String[] items = { "this", "is", "a", "really", "really2", "really3",
"really4", "really5", "silly", "list" };
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
selection = (TextView) findViewById(R.id.selection);
GridView gv = (GridView) findViewById(R.id.grid);
ArrayAdapter<String> aa = new ArrayAdapter<String>(
this,
android.R.layout.simple_list_item_1,
items );
gv.setAdapter(aa);
gv.setOnItemClickListener(this);
}
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
selection.setText(items[position]);
}
}// class
at the link
Because I don't know how many rows will contains the data set selected by the user I should implement a gridView that receives different data arrays for each column.
Es
String dataColumn1[]=....
String dataColumn2[]=....
String dataColumn3[]=....
Or alternatively a method that limit the rows to a specified int, so also with a single array I could solve my problem.