2013-08-11 11 views
5

Superuser app è installato sul mio telefono, ma la mia app cade quando si cerca di fare una richiesta di superutente con il seguente errore:attività Superuser non trovato

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) 
    ... 

di qui richiesta facendo Cide dalla mia attività:

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

potrebbe essere necessario vedere questo: http://stackoverflow.com/questions/3988454/request-superuser-rights-to-edit-file –

risposta

1

Abilita le file.Have manifesta avete dichiarato correttamente la vostra attività in questo modo:

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

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