简体   繁体   中英

Android Emulator can't find Launcher Icon

I create an Android project.I run this project on my emulator. And a get e message: \\GraphicsAndStyles\\bin\\GraphicsAndStyles.apk installed on device

When I open my emulator I can't see my Launcher icon and I can't start my application. Can anyone help me about this?

Here is the xml code in my Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.graphicsandstyles"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="18" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.graphicsandstyles.List"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.LIST" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.example.graphicsandstyles.Styles"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.example.graphicsandstyles.Themes"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.THEMES" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
    </application>

</manifest>

Keep both of these inside the intent-filter of the same activity to make icon visible as below:

<intent-filter >  
   <action android:name="android.intent.action.MAIN" />   
   <category android:name="android.intent.category.LAUNCHER"/>  
</intent-filter>  

Currently, you kept these two fields seperately in two separate activities, so please change it to:

<activity
            android:name="com.example.graphicsandstyles.List"
            android:label="@string/app_name" >  
            <intent-filter>  
                <action android:name="android.intent.action.LIST" />  
                <category android:name="android.intent.category.LAUNCHER" />   
            </intent-filter>  
</activity>

You can find detailed information about the usage of these two manifest tags here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM