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.
Asked
Active
Viewed 7,012 times
-2
-
3http://stackoverflow.com/questions/8134884/android-how-to-programmatically-hide-launcher-icon – Skynet Feb 22 '14 at 12:35
-
3why 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 Answers
2
Have a look on this link. May be it will help you
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();
}
}
}
-
-
okay, than don't do with xml. handle through the Nun Chai but use broadcast for handling through dial pad – Akarsh M Feb 22 '14 at 12:44