Dskato Dskato - 2 years ago 326
Android Question

android.content.ActivityNotFoundException: No Activity found to handle Intent

please help , when i run the app, the app launch a Fatal Error im learning
just i create a instat with a call but not run, (sorry for my english)

my manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"

<uses-permission android:name="android.permission.CALL_PHONE" />
<activity android:name=".MainActivity">
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.APP_CONTACTS" />
<activity android:name=".SecondActivity"></activity>


my code:

public class SecondActivity extends AppCompatActivity {

private EditText editPhoneText;
private ImageButton imageCallButton;
private final int PHONE_CALL_CODE = 100;

protected void onCreate(Bundle savedInstanceState) {

editPhoneText = (EditText) findViewById(R.id.editTextPhone);
imageCallButton = (ImageButton) findViewById(R.id.imageCallButton1);

imageCallButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {

public void implicito(){

Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("Tel: 9999999" ));


Answer Source

You may want to check whether your device can handle your intent by doing this:

PackageManager packageManager = getPackageManager();
if (intent.resolveActivity(packageManager) != null) {
} else {
     Log.d(TAG, "Cannot handle this intent");

What's more, if you are placing a call like so, there is NO need to declare the permission in your manifest:

<uses-permission android:name="android.permission.CALL_PHONE" />

Because you are not directly calling someone within your app. You are actually transferring the "duty" to other apps which can handle your intent to call. This doesn't need a permission.

To directly make a call within your app, the intent should be Intent.ACTION_CALL, which needs the permission you declared.

Hope this will help.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download