Hi all,
I am trying to develop an application with a TabView. Inside this View there
are two ListView implemented with a cursorAdapter (taking data from the
database). All work perfectly except that, when I try to put a listener on
the lists, it does not work.
// sets listener on sessions list
sessionList.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int
arg2,
long arg3) {
Intent i = new Intent();
i.setClass(TrainingList.this, SessionReview.class);
//i.putExtra(TrainingDbAdapter.KEY_ACTID, arg3);
startActivityForResult(i, ACTIVITY_TRAINING_SESSION);
}
});
The problem is only with the CursorAdapter because when I try to populate
the list with a simple static ArrayAdapter, the listener is working.
ts.setContent(new TabHost.TabContentFactory() {
public ListView createTabContent(String tag) {
mDbCsmSession = mDbHelper.fetchAllSessions();
String[] columns = new String[] {
TrainingDbAdapter.KEY_NAME,
TrainingDbAdapter.KEY_DESC };
SimpleCursorAdapter adapter = new SimpleCursorAdapter(
TrainingList.this,
R.layout.session_list_item,
mDbCsmSession,
columns,
new int[] { R.id.session_name,
R.id.session_description });
//startManagingCursor(mDbCursor);
sessionList.setAdapter(adapter);
return sessionList;
}
});
Is anyone able to help me plz?
Thks
Ciao
--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en