当我运行项目时,我的应用程序不会在模拟器上显示

时间:2012-12-12 18:52:29

标签: java android android-emulator

当我尝试运行项目时,它会在模拟器上成功安装,但模拟器不会在其应用程序菜单中显示我的应用程序启动器图标。但是它在设置>应用程序>管理应用程序>所有应用程序中显示已安装应用程序中的应用程序,这意味着安装了应用程序。但它没有运行。

清单:

<?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>

2 个答案:

答案 0 :(得分:0)

确保您的启动活动在清单中正确声明了其意图过滤器,以便在启动器中显示。

假设您希望“Splash”成为您的主要活动,请将其声明更改为此(特别是意图过滤器操作)

 <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>

你的意图过滤器动作不是android默认值(以及通常寻找的启动器)的一部分。只有设计用于寻找动作“com.thenewboston.travis.SPLASH”的发射器才能看到您的活动

答案 1 :(得分:-1)

 <activity
    android:name=".Splash"
    android:label="@string/app_name" >
    <intent-filter>
        <action android:name="com.thenewboston.travis.SPLASH" /> //try "android.intent.action.MAIN" here//
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>
相关问题