Android app with open phone

I just want to open the phone call application of an Android device. I do not want to provide this application with a phone number. I just want to open it.
I use the name of the application package for the phone to open it. Because I can open any application that I want to get through this package name using the code below.

Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.android.contacts"); startActivity(launchIntent);

I can’t open the Phone and Contacts application with the above code. What could be the problem?

+3
source share
2 answers

Intents ( pwn (damn!)), , . , , . , , , .

//For the contacts (picking one)
 Intent i = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
//For the contacts (viewing them) 
 Intent i = new Intent(Intent.ACTION_VIEW, ContactsContract.Contacts.CONTENT_URI);
//For the dial pad
 Intent i = new Intent(Intent.ACTION_DIAL, null);
//For viewing the call log
 Intent i = new Intent(Intent.ACTION_VIEW, CallLog.Calls.CONTENT_URI);

useful intents -, , .

, , startActivity(i); , , , startActivityForResult(i);, .

+18

All Articles