tags:

views:

57

answers:

1

I have this code:

    db=(new DatabaseHelper(this)).getWritableDatabase();
    constantsCursor=db.rawQuery("SELECT _ID, title, subtitle, image "+
                                                            "FROM news ORDER BY title",
                                                            null);

    ListAdapter adapter=new SimpleCursorAdapter(this,
                                                R.layout.row, constantsCursor,
                                                new String[] {"title", "subtitle", "image"},
                                                new int[] {R.id.value, R.id.title, R.id.icon});

    setListAdapter(adapter);
    registerForContextMenu(getListView());

Which displays a list of titles. I dont however for the life of me know how to create a click event so that i can call another view when i click an item from that list.

Anyone?

+2  A: 

If you are extending a ListActivity then you can implement the onListItemClick method. See: http://d.android.com/reference/android/app/ListActivity.html#onListItemClick

disretrospect