java.lang.SecurityException:Permission Denial:启动Intent cmp = com.android.dialer / com.android.incallui.InCallActivity}

时间:2015-06-03 07:12:08

标签: android android-intent permissions

我尝试使用以下意图从我的演示活动中启动InCallActivity

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

但是这不起作用并向我展示了例外,然后我尝试启动其他活动,例如com.android.dialer.DialtactsActivitycom.android.mms.ui.ComposeMessageActivity,我可以成功启动这些活动。

这是logcat输出:

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)

这是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>

InCallAcitivity与其他应用程序的活动不同吗?我不知道如何解决我的问题。此问题是由许可引起的吗?

0 个答案:

没有答案