简体   繁体   中英

Android Application is not showing up in the App Drawer

Hey I have a bit of a problem trying to locate my application in the App Drawer, it shows up everywhere else - Recent Applications (by holding down home) and it is also in the settings under Applications.

The only place it isn't is in the app drawer, my first guess is the Manifest?

The application runs perfectly fine.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.zaknorris.brainhacker.v1"
android:versionCode="1"
android:versionName="1.0" >

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

<application
    android:icon="@drawable/ic_launcher"
    android:label="Brain Hacker Pro"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="Brain Hacker Pro" >
        <intent-filter>
            <action android:name="com.zaknorris.brainhacker.v1.Menu" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".attentionbuilder"
        android:label="Attention Builder" >
        <intent-filter>
            <action android:name="com.zaknorris.brainhacker.v1.attentionbuilder" />

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

The icon is in the drawable is there and everything.

Not sure what's going on :\\

New in Java

you need to have this:

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

inside of one of your activity elements

Change your AndroidManifest to this one:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.zaknorris.brainhacker.v1"
android:versionCode="1"
android:versionName="1.0" >

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

<application
    android:icon="@drawable/ic_launcher"
    android:label="Brain Hacker Pro"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="Brain Hacker Pro" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".attentionbuilder"
        android:label="Attention Builder" >
        <intent-filter>
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

Set MainLauncher=true in IntentFilter for the activity which you would want to open first. This answer is with respect to Xmarin.android.

For android Java:

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

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