Hide app icon from launcher

I have an android app. I want to hide the application icon from the launch screen and make it visible again after dialing without ie "1234". Any useful piece of code would be appreciated.

-2
source share
1 answer

Take a look at this link. Maybe this will help you.

hidden application

Change 1:

Firstly:

PackageManager p = getPackageManager(); p.setComponentEnabledSetting(getComponentName(), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); 

The second:

 public class DialBroad extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { String phoneNumber = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER); if ((phoneNumber).equals("123456")) { Intent appIntent = new Intent(context, MainActivity.class); appIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(appIntent); setResultData(null); } else { // Toast.makeText(context, phoneNumber, Toast.LENGTH_LONG).show(); } } } 
+2
source

All Articles