Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

SOLVED: Android getting specific item for a row in ListView

Ehatsham Riaz:

I have make a Listview Which have some Rows. Know by ItemClickListener I want to access Which item of the row is clicked here is my code..


lstcontact.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView> parent, View view, int position, long id) {

String v=lstcontact.getItemAtPosition(position).toString();
if(view.getId()==R.id.btncall) {
Toast.makeText(MainActivity.this, "MAke A Call at "+position, Toast.LENGTH_SHORT).show();
}else if(view.getId()==R.id.btnmess) {
Toast.makeText(MainActivity.this, "MAke A Message at "+position, Toast.LENGTH_SHORT).show();
}
}


});[I want to display a toast when User click on message icon or call][1]



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered
HERE


This post first appeared on Stack Solved, please read the originial post: here

Share the post

SOLVED: Android getting specific item for a row in ListView

×

Subscribe to Stack Solved

Get updates delivered right to your inbox!

Thank you for your subscription

×