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