Android: How to create an onclick event for a SimpleCursorAdapter?

Posted by user117701 on Stack Overflow See other posts from Stack Overflow or by user117701
Published on 2010-06-07T21:00:22Z Indexed on 2010/06/07 21:32 UTC
Read the original article Hit count: 554

Filed under:

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?

© Stack Overflow or respective owner

Related posts about android