未找到超级用户活动

时间:2013-08-11 06:04:04

标签: android android-intent root

我的手机上安装了超级用户应用程序,但在尝试发出超级用户请求时我的应用程序出现了以下错误:

18820-18820/com.anth.res E/AndroidRuntime: FATAL EXCEPTION: main
    android.content.ActivityNotFoundException: No Activity found to handle Intent { act=act=android.intent.action.superuser (has extras) }
    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1512)
    ...

这是我的活动请求:

command = "su -c \""+command+"\"";
Intent intent = new Intent("android.intent.action.superuser"); // superuser request
intent.putExtra("name", getResources().getString(R.string.app_name)); // tell Superuser the name of the requesting app
intent.putExtra("packagename", "com.anth.res"); // tel Superuser the name of the requesting package
startActivityForResult(intent, SU_REQUEST); // make the request!

1 个答案:

答案 0 :(得分:1)

请检查您的清单文件。您是否正确地宣布了您的活动:

<activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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