Android隐藏/取消隐藏应用程序图标

时间:2016-02-26 11:34:52

标签: android

有人可以建议我隐藏和取消隐藏应用图标吗?隐藏图标后,如果用户拨打特定号码(如1234),我想启动应用程序。我该怎么做?

1 个答案:

答案 0 :(得分:0)

好吧,如上所述,问题的第一部分是Android: How to Remove/Uninstall application shortcuts from Home Screen?的副本。

至于第二部分,您需要使用BroadcastReceiver,并且已由Using Broadcast receiver to detect the outgoing calls等人回答。

但是请注意,您需要在清单中部署一个intent过滤器,因为所有意图都会调用BroadcastReceiver。

<receiver android:name=".OutgoingCallReceiver" >
    <intent-filter>
        <action android:name="android.intent.action.NEW_OUTGOING_CALL" />
    </intent-filter>
</receiver>

并添加权限:

<uses-permission android:name="android.permission.READ_PHONE_STATE" />

最后,在Android 6.0及更高版本中,这是一个dangerous permission。在使用之前,您需要明确要求它。因此,最好不要在获取应用程序之前从主页中删除该应用程序。

相关问题