Error Handling: Repeat No Launcher activity found!

Source: Internet
Author: User

Error Handling: Repeat No Launcher activity found!


Repeat No Launcher activity found! Error message and Solution


No Launcher activity found in Android Application Development! Is a common error, and the solution is also very simple.

I have been developing Android for a long time. I believe that I will not easily make this mistake, but today I have encountered it again. I have already added it to the AndroidManifest. xml file.

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

Where is the problem?


Let's look at the specific code first.

The AndroidManifest. xml file contains the following content:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"    package="com.app.test"    android:versionCode="1"    android:versionName="1.0" >    <uses-sdk        android:minSdkVersion="9"        android:targetSdkVersion="15" />    <uses-permission android:name="android.permission.NFC" />    <uses-feature        android:name="android.hardware.nfc"        android:required="true" />    <application        android:allowBackup="true"        android:debuggable="true"        android:icon="@drawable/icon"        android:label="@string/app_name"        android:theme="@style/AppTheme" >        <activity            android:name="com.app.test.MainActivity"            android:label="@string/title_activity_main" >            <intent-filter>                <action android:name="android.intent.action.MAIN" />                <category android:name="android.intent.category.LAUNCHER" />                <action android:name="android.nfc.action.TAG_DISCOVERED" />            </intent-filter>        </activity>    </application></manifest>

The information in the console during running is as follows:


This is the case when I run it multiple times, and no problem is found.

After multiple experiments, You can adjust AndroidManifest. xml as follows.

The adjusted AndroidManifest. xml file is as follows:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"    package="mexxen.app.test"    android:versionCode="1"    android:versionName="1.0" >    <uses-sdk        android:minSdkVersion="9"        android:targetSdkVersion="15" />    <uses-permission android:name="android.permission.NFC" />    <uses-feature        android:name="android.hardware.nfc"        android:required="true" />    <application        android:allowBackup="true"        android:debuggable="true"        android:icon="@drawable/icon"        android:label="@string/app_name"        android:theme="@style/AppTheme" >        <activity            android:name="mexxen.app.test.MainActivity"            android:label="@string/title_activity_main" >            <intent-filter>                <action android:name="android.intent.action.MAIN" />                <category android:name="android.intent.category.LAUNCHER" />            </intent-filter>            <intent-filter>                <category android:name="android.intent.category.TAG_DISCOVERED" />            </intent-filter>        </activity>    </application></manifest>


The running effect is as follows:



Conclusion:


When specifying the Activity to start the main interface, try not to put irrelevant actions, category and LAUNCHER in a <intent-filter>.



----------------------------------

Welcome to browse, technical exchange, respect for labor achievements, repost, please indicate the source, thank you! Http://blog.csdn.net/netwalk/article/details/35289751






Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.