
Untitled
By: a guest on
Apr 28th, 2012 | syntax:
None | size: 0.60 KB | hits: 24 | expires: Never
onListItemClick returns data from the item at the top of current view
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
// Get the item that was clicked
TextView tv = (TextView)findViewById(R.id.item_title);
Toast.makeText(getApplicationContext(), (tv).getText(),
Toast.LENGTH_SHORT).show();
}
A
----- (Start of Viewable area)
B
C
D
------(End of viewable area)
E
// Call on the child view provided as a parameter, instead of on the ListView
TextView tv = (TextView)v.findViewById(R.id.item_title);