隐藏的Andr​​oid应用程序图标安装后, [英] Hide android application icon after install

查看:117
本文介绍了隐藏的Andr​​oid应用程序图标安装后,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我见过的,有在谷歌应用程序的地方,安装完毕后,应用程序将没有图标显示尚未将在后台运行的服务的一些GPS应用。

I've seen that there are some GPS application on Google apps where, after installation, the application will have no icon display yet will run services in the background.

我将如何实现这一目标?

How would I achieve this?

推荐答案

有关从启动删除应用程序只是没有把这些线,主要活动在的Andr​​oidManifest.xml

For removing Application from Launcher just do not put these lines with main Activity in AndroidManifest.xml

<intent-filter>
  <action android:name="android.intent.action.MAIN" />
  <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

如果你想以编程方式删除它,然后使用<一个href="http://developer.android.com/reference/android/content/pm/PackageManager.html">PackageManager.setComponentEnabledSetting为从启动删除它:

  ComponentName componentToDisable =
  new ComponentName("com.xxx.apptodisable",
  "com.xxx.apptodisable.LauncherActivity");

  getPackageManager().setComponentEnabledSetting(
  componentToDisable,
  PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
  PackageManager.DONT_KILL_APP);

这篇关于隐藏的Andr​​oid应用程序图标安装后,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆