Hello, I am trying to create a simple hello world application and then dial the selected contacts number from my contacts. I can seem to figure out how to connect the selected user to his phone number. I have been playing with this for a few days. Any help would be appreciated.
@Override // the class that is called every time the user clicks something protected void onListItemClick(ListView l, View v, int position, long id) { // TODO Auto-generated method stub super.onListItemClick(l, v, position, id); // the reflections of a applications intent to perform some activity // in this case a call action to dial the phone Intent i = new Intent(Intent.ACTION_CALL); Cursor c = (Cursor) mAdapter.getItem(position); //get the lookup key for the phone number String phoneId = c.getString(c.getColumnIndex(Contacts.LOOKUP_KEY)); //find the phone number in ContactsContract //set the phone number in the intent to dial //i.setData(phoneNum); // Causes the dialer to appear on the screen and initiate the phone call //startActivity(i); } } -- "If men were angels, no government would be necessary." --Madison -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en