当我尝试运行该项目时,它会在模拟器上成功安装,但模拟器不会在其应用程序菜单中显示我的应用程序启动器图标。但它在设置>应用程序>管理应用程序>所有应用程序中的已安装应用程序中显示我的应用程序,这意味着应用程序已安装。但它没有运行。
list :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.thenewboston.travis"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".Splash"
android:label="@string/app_name" >
<intent-filter>
<action android:name="com.thenewboston.travis.SPLASH" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Main"
android:label="@string/app_name" >
<intent-filter>
<action android:name="com.thenewboston.travis.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Menu"
android:label="@string/app_name" >
<intent-filter>
<action android:name="com.thenewboston.travis.MENU" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
最佳答案
确保您的启动 Activity 在 list 中正确声明了其 Intent 过滤器,以便在启动器中显示。
假设您希望“Splash”成为您的主要 Activity ,请将其声明更改为此(特别是 Intent 过滤器操作)
<activity
android:name=".Splash"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
您的 Intent 过滤器操作不是 Android 默认值的一部分(以及启动器通常寻找的内容)。只有旨在查找“com.thenewboston.travis.SPLASH”操作的启动器才会看到您的 Activity
关于java - 当我运行项目时,我的应用程序未显示在模拟器上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13846608/