how to get phonenumber when i fire the name

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

how to get phonenumber when i fire the name

Postby murali.lancer » Wed Sep 23, 2009 7:17 am

hi ,i developed a contacts application i got the contacts names and phone numbers from the database of the phone .and i added the contacts to the listview.
cursor =managedQuery(Contacts.People.CONTENT_URI, null, null, null, Contacts.People.NAME + " ASC");
madapter=new ArrayAdapter(this,android.R.layout.simple_list_item_1,namesVector);
here namesVector contains all the names of the contacts .and i also got the phone numbers and stored those are in numbersVector.
cur.getString(cur.getColumnIndex(Contacts.People.NAME)); ,
using these i got those two .

and all the contacts are displaying in the phone normally.
now i want get that phone number whenever i clicked that name in the contcts list.can u tell me how can i get that.

protected void onListItemClick(ListView l, View v, int position, long id)
super.onListItemClick(l, v, position, id);
//here i want to handle the event.and should display the details of that contacts in anothe screen .

if anyobdy knows tell me
Posts: 37
Joined: Mon Jul 13, 2009 10:37 am
Location: banglore


Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 4 guests