Why isn't my activity visible in Android "all apps"

231 views Asked by At

I am trying to create an splash screen activity which will do some pre required Network calls before the real app starts. However, the app icon does not show in "all apps" on android. Can you help me? Here is my manifest code related to the activity:

<activity
        android:name=".SplashActivity"
        android:label="@string/app_name"
        android:noHistory="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.LAUNCHER" />

            <data android:mimeType="application/pdf" />
            <data android:mimeType="text/plain" />
            <data android:mimeType="application/rtf" />
            <data android:mimeType="image/jpeg" />
            <data android:mimeType="image/png" />
            <data android:mimeType="image/tiff" />
            <data android:mimeType="image/bmp" />
            <data android:mimeType="image/gif" />
            <data android:mimeType="application/postscript" />
            <data android:mimeType="application/msword" />
            <data android:mimeType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
            <data android:mimeType="application/vnd.ms-powerpoint" />
            <data android:mimeType="application/vnd.ms-excel" />
            <data android:mimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.document" />
        </intent-filter>

    </activity>

The complete application code from the manifest looks like this:

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/Theme.AppCompat.Light.NoActionBar" >
    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
    <meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="AIzaSyD1e3EbexMClXfkyULNViJlOPgeubzZdfI" />

    <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:screenOrientation="sensorPortrait" >
    </activity>
    <activity
        android:name=".PrintJobActivity"
        android:label="@string/app_name"
        android:screenOrientation="sensorPortrait" >
    </activity>
    <activity
        android:name=".SelectPrinterOptionsActivity"
        android:label="@string/title_activity_select_printer_options"
        android:launchMode="singleTop"
        android:parentActivityName=".PrintJobActivity" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value=".PrintJobActivity" />
    </activity>
    <activity
        android:name=".PrintRangeActivity"
        android:label="@string/title_activity_print_range"
        android:parentActivityName=".PrintJobActivity" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value=".PrintJobActivity" />
    </activity>
    <activity
        android:name=".SelectPrinterMapActivity"
        android:label="@string/title_activity_select_printer_map"
        android:parentActivityName=".SelectPrinterOptionsActivity" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value=".SelectPrinterOptionsActivity" />
    </activity>
    <activity
        android:name=".PrintPreviewActivity"
        android:label="@string/title_activity_print_preview"
        android:parentActivityName=".SelectPrinterOptionsActivity" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value=".SelectPrinterOptionsActivity" />
    </activity>

    <service
        android:name=".network.NetworkService"
        android:exported="false" >
    </service>

    <activity
        android:name=".OrderInfoActivity"
        android:label="@string/title_activity_order_info_activitty" >
    </activity>
    <activity
        android:name=".OrderDetailsActivity"
        android:label="@string/title_activity_order_details" >
    </activity>
    <activity
        android:name=".TermsAndConditionsActivity"
        android:label="@string/title_activity_terms_and_conditions" >
    </activity>
    <activity
        android:name=".SplashActivity"
        android:label="@string/app_name"
        android:noHistory="true"
        android:logo="@mipmap/ic_launcher">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.LAUNCHER" />

            <data android:mimeType="application/pdf" />
            <data android:mimeType="text/plain" />
            <data android:mimeType="application/rtf" />
            <data android:mimeType="image/jpeg" />
            <data android:mimeType="image/png" />
            <data android:mimeType="image/tiff" />
            <data android:mimeType="image/bmp" />
            <data android:mimeType="image/gif" />
            <data android:mimeType="application/postscript" />
            <data android:mimeType="application/msword" />
            <data android:mimeType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
            <data android:mimeType="application/vnd.ms-powerpoint" />
            <data android:mimeType="application/vnd.ms-excel" />
            <data android:mimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.document" />
        </intent-filter>

    </activity>
</application>
2

There are 2 answers

1
Budius On BEST ANSWER

you must create separate intent-filter to each action:

 <activity
    android:name=".SplashActivity"
    android:label="@string/app_name"
    android:noHistory="true">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:mimeType="application/pdf" />
        <data android:mimeType="text/plain" />
        <data android:mimeType="application/rtf" />
        <data android:mimeType="image/jpeg" />
        <data android:mimeType="image/png" />
        <data android:mimeType="image/tiff" />
        <data android:mimeType="image/bmp" />
        <data android:mimeType="image/gif" />
        <data android:mimeType="application/postscript" />
        <data android:mimeType="application/msword" />
        <data android:mimeType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
        <data android:mimeType="application/vnd.ms-powerpoint" />
        <data android:mimeType="application/vnd.ms-excel" />
        <data android:mimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.document" />
    </intent-filter>
</activity>
2
user5010376 On

Were your android:logo or android:icon look the above:

    android:name=".SplashActivity"
    android:label="@string/app_name"
    **android:logo="ic_luncher.png"**
    android:noHistory="true"