Can anyone suggest me how to hide and unhide an app icon? After hiding the icon I would like to launch the app if user called on specific number like 1234. How would I do that?
Asked
Active
Viewed 883 times
1
-
Possible duplicate of [android app without icon](http://stackoverflow.com/questions/14174993/android-app-without-icon) – Strider Feb 26 '16 at 11:40
-
Possible duplicate of [Android hide/unhide app icon programmatically](http://stackoverflow.com/questions/19114439/android-hide-unhide-app-icon-programmatically) – Amsheer Feb 26 '16 at 11:40
1 Answers
0
Well, as noted above, the first part of the question is a duplicate of Android: How to Remove/Uninstall application shortcuts from Home Screen? among others.
As for the second part, you need to use a BroadcastReceiver and that has been answered by Using Broadcast receiver to detect the outgoing calls among others.
Note however, that you need to deploy an intent filter in your manifest, as a BroadcastReceiver is called for all intents.
<receiver android:name=".OutgoingCallReceiver" >
<intent-filter>
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
</intent-filter>
</receiver>
And add a permission as well:
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
Finally, in Android 6.0 and above, this is a dangerous permission. You'll need to explicitly ask for it before you can use it. So it's a good idea not to remove the app from the home page before you get it.