Launch error not detected

I created a very simple action that displays the world hello and the LEST TEST button, when I press this button, Toast will show a message, and I launched this application on the emulator.

the problem is that when I try to run this application, the console displays that

no launcher activity found

and nothing is displayed on the emulator, although the code has no error at all.

manifest.xml:

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

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

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".QR00"
        android:label="@string/title_activity_qr00" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="QR00" />
    </activity>
</application>

Can someone tell me how to solve the "no launcher activity found" error?

+1
source share
4 answers

You need to add

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

So:

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

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

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".QR00"
        android:label="@string/title_activity_qr00" >
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="QR00" />
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>
+3
source

You need to add this intent to the Menifest file.

<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
    android:name=".QR00"
    android:label="@string/title_activity_qr00" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    <meta-data
        android:name="android.support.PARENT_ACTIVITY"
        android:value="QR00" />
</activity>

+1
source

you can add this code to your manifest file in the activity tag.

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".QR00"
        android:label="@string/title_activity_qr00" >
<intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="QR00" />
    </activity>
</application>
0
source

add like this

      <activity
            android:name=".YourclassName"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />    
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
0
source

All Articles