没有应用程序图标的应用 [英] Application without app icon
问题描述
我打算做一个应用程序,其中只包含一个活动,没有任何应用程序图标,在这里我需要使用键盘打开此活动。比方说,当你拨打 12345
我的应用程序的活动应该没有应用程序图标打开。在Android是这可能吗?怎么样?
I plan to do an app which contains only one activity and without any app icon, where I need to open this activity by using the keypad. Say for example, whenever you dial 12345
my application activity should open without an app icon. Is this possible in Android? How?
推荐答案
您必须对安卓指定绘制资源code>的
的AndroidManifest.xml
元素。从文档:
此属性必须设置作为参考,以包含图像的可绘制的资源(例如,@可拉伸/图标)。没有默认的图标。
This attribute must be set as a reference to a drawable resource containing the image (for example "@drawable/icon"). There is no default icon.
但是指定的提拉并不需要是一个图标。它可以在你的资源被定义为颜色:
But the drawable specified doesn't need to be an icon. It can be defined as color in your resources:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<drawable name="color_icon">#ff0000</drawable>
</resources>
然后在其指定的的AndroidManifest.xml
:
<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
<application android:icon="@drawable/color_icon" ...>
...
</application>
</manifest>
,你会看到在应用程序启动板是这样的:
And you'll see something like this in your application launchpad:
这篇关于没有应用程序图标的应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!