0

I have a custom list view over here that displays data from a sqlite database with the help of a simple cursor adapter. I would like to know how to display a toast showing the title of each entry (e.g. School) when I hold down each entry (using a longClickListener). Thanks.

The method for the simple cursor adapter which is called during onResume:

    private void populateListViewFromDatabase() {
    DBAdapter db = new DBAdapter(this);
    db.open();
    Cursor c = db.retrieveAllEntriesCursor();

    String[] from = {DBAdapter.ENTRY_TITLE, DBAdapter.ENTRY_DESTINATION};
    int[] to = {R.id.tvAlarmTitle, R.id.tvAlarmDestination};

    SimpleCursorAdapter myCursorAdapter = new SimpleCursorAdapter(this,R.layout.custom_alarm_destination_row,c,from,to);
    db.close();
    lvDestinations.setAdapter(myCursorAdapter);
}

0 Answers0