I\'ve made a simple app in android with list View,In that i want to make a toast when select an item,i have tried as below but its not working..
my code is as below:
I hope this way get selected item
lv.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView> arg0, View arg1, int position,
long arg3) {
// TODO Auto-generated method stub
// Toast.makeText(getApplicationContext(),"Position is: "+ position, Toast.LENGTH_LONG).show();
String selectedFromList = lv.getItemAtPosition(position).toString();
Toast.makeText(getApplicationContext(),selectedFromList , Toast.LENGTH_LONG).show();
}
});