即时通讯使用我自己的启动器我从github https://github.com/strider2023/Black-Launcher--Android-获取此启动器应用程序是手机中的安装启动器但我也想在启动器中添加我的应用程序所以当启动器安装我的应用程序时也安装在启动器内并自动启动我的应用程序启动后启动。这是我的appplication类文件下面的启动器显示文件是MainActivity.java如何在启动启动器后启动我的应用程序???
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.touchmentapps.black"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="15"/>
<permission
android:name="com.android.launcher.permission.INSTALL_SHORTCUT"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="normal" />
<permission
android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="normal"/>
<permission
android:name="com.android.launcher.permission.READ_SETTINGS"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="normal"/>
<permission
android:name="com.android.launcher.permission.WRITE_SETTINGS"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="normal"/>
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.SET_WALLPAPER_HINTS" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.BIND_APPWIDGET" />
<uses-permission android:name="com.android.launcher.permission.READ_SETTINGS" />
<uses-permission android:name="com.android.launcher.permission.WRITE_SETTINGS" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:hardwareAccelerated="true"
android:largeHeap="true">
<activity
android:name=".BlackLauncherActivity"
android:launchMode="singleTask"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"
android:windowSoftInputMode="adjustPan"
android:theme="@style/Theme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.MONKEY"/>
</intent-filter>
</activity>
<activity android:name=".Activity2"/>
</application>
</manifest>
答案 0 :(得分:0)
据我了解你的问题,你想看到你的应用程序显示在启动器中?
这与intent-filters有关:http://developer.android.com/guide/components/intents-filters.html
Black启动程序会查找标记为“LAUNCHER”应用程序的应用程序。您可以在此处的代码中看到:https://github.com/strider2023/Black-Launcher--Android-/blob/master/Black%20Launcher/src/com/touchmentapps/black/functions/AppInfoHandlerFunctions.java
您必须在清单文件中添加活动标记,并包含LAUNCHER类别。
<activity
android:name=".MyActivity"
android:launchMode="singleTask"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"
android:windowSoftInputMode="adjustPan"
android:theme="@style/Theme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>