-2

I have an android application. I want to hide app icon from launcher screen & make it visible again after dialing some no i.e "1234" . Any helpful code snippet will be appreciated.

user3169552
  • 107
  • 1
  • 5
  • 11
  • 3
    http://stackoverflow.com/questions/8134884/android-how-to-programmatically-hide-launcher-icon – Skynet Feb 22 '14 at 12:35
  • 3
    why are posting same question multiple times..here is the same question from you..http://stackoverflow.com/questions/21847763/how-to-hide-app-from-launcher-in-android – kalyan pvs Feb 22 '14 at 12:36

1 Answers1

2

Have a look on this link. May be it will help you

hidden App

Edit 1:

First:

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

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();
        }
    }
}
Raymond
  • 1,943
  • 2
  • 18
  • 30
Akarsh M
  • 1,598
  • 2
  • 23
  • 46