Vis*_*ale 12
只需从AndroidManifest.xml中的主Activity中删除android.intent.category.LAUNCHER即可
并且您无法通过拨号打开应用程序,*#*#12345#*#*因为为了做到这一点,您必须编写接收器以执行以下操作
<action android:name="android.provider.Telephony.SECRET_CODE" />
Run Code Online (Sandbox Code Playgroud)
然后,您可以通过从该广播接收器触发Intent来打开您的应用.但是在你的应用程序是*System app之前,android不允许这样做.*
以下代码将帮助您将Manifest中的活动更改为没有类似的意图过滤器
<activity
android:name=".MyApp"
android:label="@string/title_activity_parent_trap"
android:theme="@android:style/Theme.Holo" >
</activity>
<receiver android:name=".MyApp$Launch" >
<intent-filter>
<action android:name="android.provider.Telephony.SECRET_CODE" />
<data
android:host="(secret code)"
android:scheme="android_secret_code" />
</intent-filter>
</receiver>
Run Code Online (Sandbox Code Playgroud)
完成后,创建一个类(我在我的主类中创建了Launch类,扩展了BroadCast Receiver),然后在onReceive类中启动了一个启动活动的意图.
然后输入*#*#(secret code)#*#*拨号器将启动该应用程序.
您必须为的元素android:icon中的属性指定可绘制资源。来自文档:applicationAndroidManifest.xml
该属性必须设置为对包含图像的可绘制资源的引用(例如“@drawable/icon”)。没有默认图标。
但指定的可绘制对象不必是图标。它可以定义为资源中的颜色:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<drawable name="color_icon">#ff0000</drawable>
</resources>
Run Code Online (Sandbox Code Playgroud)
然后在您的中指定它AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
<application android:icon="@drawable/color_icon" ...>
...
</application>
</manifest>
Run Code Online (Sandbox Code Playgroud)
您将在应用程序启动板中看到类似以下内容:

| 归档时间: |
|
| 查看次数: |
10676 次 |
| 最近记录: |