I seems to be lacking knowledge about handling such intents, however couldnt find answer for a while.
I have an activity with one fragment. The fragment executes this code in purpose of calling a contact:
private void onCall() {
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(contact.getBusinessPhone()));
startActivity(intent);
}
Also included permission
<uses-permission android:name="android.permission.CALL_PHONE"></uses-permission>
The output is No Activity found to handle Intent
and the app crashes.
Here is manifest implementation of the activity that holds fragment:
<activity android:name="activities.ContactActivity">
<intent-filter>
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
What am I doing wrong? Do I need some special activity declared in manifest for that?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…