2

I tried to start the InCallActivity from my demo activity, using the following intent:

Intent i = new Intent();
i.setClassName("com.android.dialer", "com.android.incallui.InCallActivity");
startActivity(i);

But that could not work and showed me the exception, then I tried to start others activitys like com.android.dialer.DialtactsActivity and com.android.mms.ui.ComposeMessageActivity, I could start these successfully.

Here is the logcat output:

06-03 15:00:55.395: E/AndroidRuntime(9675): java.lang.SecurityException: Permission Denial: starting Intent { cmp=com.android.dialer/com.android.incallui.InCallActivity } from ProcessRecord{3f9e9808 9675:cn.vjack.testtheme/u0a86} (pid=9675, uid=10086) not exported from uid 10004
06-03 15:00:55.395: E/AndroidRuntime(9675):     at android.os.Parcel.readException(Parcel.java:1546)
06-03 15:00:55.395: E/AndroidRuntime(9675):     at android.os.Parcel.readException(Parcel.java:1499)
06-03 15:00:55.395: E/AndroidRuntime(9675):     at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:2526)
06-03 15:00:55.395: E/AndroidRuntime(9675):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1507)
06-03 15:00:55.395: E/AndroidRuntime(9675):     at android.app.Activity.startActivityForResult(Activity.java:3810)
06-03 15:00:55.395: E/AndroidRuntime(9675):     at android.app.Activity.startActivityForResult(Activity.java:3761)
06-03 15:00:55.395: E/AndroidRuntime(9675):     at android.app.Activity.startActivity(Activity.java:4091)
06-03 15:00:55.395: E/AndroidRuntime(9675):     at android.app.Activity.startActivity(Activity.java:4059)
06-03 15:00:55.395: E/AndroidRuntime(9675):     at cn.vjack.testtheme.MainActivity.gotoCall(MainActivity.java:48)
06-03 15:00:55.395: E/AndroidRuntime(9675):     at cn.vjack.testtheme.MainActivity.access$0(MainActivity.java:42)
06-03 15:00:55.395: E/AndroidRuntime(9675):     at cn.vjack.testtheme.MainActivity$1.onClick(MainActivity.java:36)
06-03 15:00:55.395: E/AndroidRuntime(9675):     at android.view.View.performClick(View.java:4848)
06-03 15:00:55.395: E/AndroidRuntime(9675):     at android.view.View$PerformClick.run(View.java:20260)
06-03 15:00:55.395: E/AndroidRuntime(9675):     at android.os.Handler.handleCallback(Handler.java:815)
06-03 15:00:55.395: E/AndroidRuntime(9675):     at android.os.Handler.dispatchMessage(Handler.java:104)
06-03 15:00:55.395: E/AndroidRuntime(9675):     at android.os.Looper.loop(Looper.java:194)
06-03 15:00:55.395: E/AndroidRuntime(9675):     at android.app.ActivityThread.main(ActivityThread.java:5624)
06-03 15:00:55.395: E/AndroidRuntime(9675):     at java.lang.reflect.Method.invoke(Native Method)
06-03 15:00:55.395: E/AndroidRuntime(9675):     at java.lang.reflect.Method.invoke(Method.java:372)
06-03 15:00:55.395: E/AndroidRuntime(9675):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959)
06-03 15:00:55.395: E/AndroidRuntime(9675):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)

Here is Manifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="cn.vjack.testtheme"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="19"
        android:targetSdkVersion="19" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:exported="true"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

Is InCallAcitivity different from other applications' activity? I don't know how to solve my issue. Is this problem caused by permission?

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
Violetjack
  • 401
  • 1
  • 3
  • 8

0 Answers0