I'm trying to modify APK, I want to hide it from home screen but it should be openable
This is some part of manifest:
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
I have already tried to replace LAUNCHER
with DEFAULT
but then I can't open the app, I want to open it one time only, can someone help me? Sorry for my bad English, I hope u will understand what I mean
You can find the answer in several treads in the past. You can do it programmatic by adding the below code:
Hide :
PackageManager pm = getPackageManager(); ComponentName componentName = new ComponentName(this, com.apps.MainActivity.class); pm.setComponentEnabledSetting(componentName,PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
Unhide:
PackageManager pm = getPackageManager(); ComponentName componentName = new ComponentName(this, com.apps.MainActivity.class); pm.setComponentEnabledSetting(componentName, PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.