Hi
Why don't you using ListView with ListAdapter which is pumped with data from database? To get any row - setOnItemClickListener(listener) ? Below is example :
Your Activity can implement OnItemClickListener interface.
... // onCreate()
ListView listView = new ListView(context);
listView.setOnItemClickListener(context);
...
... //your method that set listview
String[] data = new String[cursor.getCount()];
int index = 0;
...
while (cursor.moveToNext()) { // cursor is to get data from database
data[index++] = cursor.getString(0); // you get the string value from column number 0 from resultset
}
...
ArrayAdapter<String> myList = new ArrayAdapter<String>(context, R.id.your_defined_row, data); // setup ListView with data
listView.setAdapter(myList); // set listview by invoking setAdapter method with myList which contain view of row and data.
listView.invalidate(); // rebuild listview
...
public void onItemClick(AdapterView<?> av, View v, int arg2, long arg3) { // to get any row of list
}
...
Bye