Android: Ocultar aplicación en la lista de menús de Android
Frecuentes
Visto 839 veces
0
I am creating application which hide applications from Android menu list. I am using following code for hiding application.
PackageManager p = getPackageManager();
ComponentName componentName = new ComponentName(
"package name", "class name");
p.setComponentEnabledSetting(getComponentName(),
PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
PackageManager.DONT_KILL_APP);
Dudas:
- If i want to hide applications, then is it correct that i required my android phone is rooted?
Problema
- There's two activities in my application. 1st Activity display only button and after clicking,it goes to 2nd activity. I wrote above code in 2nd Activity. While executing the 2nd Activity above code did not show me any error message. But when i run my application again then it shows me error while moving on 1st Activity to 2nd activity (i.e in Intent).
Here is my Intent Code:
Intent intent = new Intent(getApplicationContext(),
DisplayApplication.class);
intent.putExtra("Pass", "P");
startActivity(intent);
Salida LogCat
11-15 14:15:45.368: E/AndroidRuntime(2707): FATAL EXCEPTION: main
11-15 14:15:45.368: E/AndroidRuntime(2707): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.lockscreenpattern/com.example.lockscreenpattern.DisplayApplication}; have you declared this activity in your AndroidManifest.xml?
11-15 14:15:45.368: E/AndroidRuntime(2707): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1405)
11-15 14:15:45.368: E/AndroidRuntime(2707): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
11-15 14:15:45.368: E/AndroidRuntime(2707): at android.app.Activity.startActivityForResult(Activity.java:2827)
11-15 14:15:45.368: E/AndroidRuntime(2707): at android.app.Activity.startActivity(Activity.java:2933)
11-15 14:15:45.368: E/AndroidRuntime(2707): at com.example.lockscreenpattern.MainActivity.onClick(MainActivity.java:124)
11-15 14:15:45.368: E/AndroidRuntime(2707): at android.view.View.performClick(View.java:2485)
11-15 14:15:45.368: E/AndroidRuntime(2707): at android.view.View$PerformClick.run(View.java:9080)
11-15 14:15:45.368: E/AndroidRuntime(2707): at android.os.Handler.handleCallback(Handler.java:587)
11-15 14:15:45.368: E/AndroidRuntime(2707): at android.os.Handler.dispatchMessage(Handler.java:92)
11-15 14:15:45.368: E/AndroidRuntime(2707): at android.os.Looper.loop(Looper.java:130)
11-15 14:15:45.368: E/AndroidRuntime(2707): at android.app.ActivityThread.main(ActivityThread.java:3687)
11-15 14:15:45.368: E/AndroidRuntime(2707): at java.lang.reflect.Method.invokeNative(Native Method)
11-15 14:15:45.368: E/AndroidRuntime(2707): at java.lang.reflect.Method.invoke(Method.java:507)
11-15 14:15:45.368: E/AndroidRuntime(2707): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
11-15 14:15:45.368: E/AndroidRuntime(2707): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
11-15 14:15:45.368: E/AndroidRuntime(2707): at dalvik.system.NativeStart.main(Native Method)
0 Respuestas
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas android android-activity android-package-managers or haz tu propia pregunta.
this exception is occur because u have have disabled your launcher activity. Restart your device your app will hide from app launcher menu. - Vijju
I restarting my phone but still the application display me.Is there any way to hide application without restarting my android phone? - Dhruv
Elimine lanzador Tag from your manifest and for any process put your code in background service - Vijju
Quitando el lanzador Tag from my manifest file, it is not showing my application icon in android menu. I want to hide other application not my application. - Dhruv
Posible duplicado de Ocultar la aplicación del menú y mostrar cuando queramos - Michael Gaskill