Error处理: 重提No Launcher activity found!

重提No Launcher activity found!错误提示,及解决的方法

Android应用开发中No Launcher activity found! 是常见的错误,并且解决的方法也非常easy。

做Android开发已经非常久了,相信自己不会轻易犯这个错误,可是今天却又遇到。在AndroidManifest.xml文件里也非常确定的已经加入了

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

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

问题在那里那?

先看详细代码吧

AndroidManifest.xml文件内容例如以下:

<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>

执行时console中信息例如以下:

执行了多次均如此,也没发现什么情况造成的。

在实验多次之后,发现将AndroidManifest.xml做例如以下调整就可以。

调整后的AndroidManifest.xml文件内容例如以下:

<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>

执行效果例如以下:

结论:



在指定启动主界面的Activity时。尽量不要把不相干的action以及category与LAUNCHER放在一个 <intent-filter>中。

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

欢迎浏览、技术交流
请尊重劳动成果
转载请注明出处。谢谢。
http://blog.csdn.net/netwalk/article/details/35289751

Error处理: 重提No Launcher activity found!的更多相关文章

  1. android编程常见问题-No Launcher activity found!

    新手编程常见的问题: 问题表现: console提示:No Launcher activity found! The launch will only sync the application pac ...

  2. android 初学: 提示No Launcher activity found!

    提示No Launcher activity found! 三步检查: 1 必须有 <category android:name="android.intent.category.LA ...

  3. Launcher Activity在开机时重新启动两次解决的方法

    今天在看log的时候发现,Launcher activity会被onDestroy掉一次.然后再重新启动. 可能原因推測: 1.横竖屏切换 2.MCC MNC等Configuration改变引起的 M ...

  4. No Launcher activity found!

    已经研究Android有几天了,刚开始写的代码说安装成功,但是在AVD没有显示.左看代码,右看代码,总是没找到错误, <application android:allowBackup=" ...

  5. android开发出现No Launcher activity found!解决方案

    在AndroidManifest.xml中的中少了这段代码 <activity android:name=".MainActivity" android:label=&quo ...

  6. Error in Android Studio - "Default Activity Not Found"

    Make sure you have specified the default activity in your AndroidManisfest.xml file. Within your def ...

  7. Android更改桌面应用程序launcher的两种方式

    http://blog.csdn.net/mdx20072419/article/details/9632779/ launcher,也就是android的桌面应用程序.下图是我正在使用的魅族手机的l ...

  8. Installation error: INSTALL_FAILED_UPDATE_INCOMPATIBLE

    Installation error: INSTALL_FAILED_UPDATE_INCOMPATIBLE 晚上在测一个widget,前面测的好好的,后面再安装的时候发现如下错误:[2009-06- ...

  9. android M Launcher之LauncherModel (二)

    上一篇我们通过LauncherModel的创建 ,实例化,以及与LauncherModel之间的沟通方式.初步了解了LauncherModel一些功能及用法,如果对LauncherModel一系列初始 ...

随机推荐

  1. CNN:测试一下YoloV3

    项目地址:https://pjreddie.com/darknet/yolo/ mAP提升了不少,在VS上试一把 V3 的权值: https://pjreddie.com/media/files/yo ...

  2. 【sqli-labs】 less61 GET -Challenge -Double Query -5 queries allowed -Variation4 (GET型 挑战 双查询 只允许5次查询 变化4)

    http://192.168.136.128/sqli-labs-master/Less-61/?id=1' 单引号双括号闭合 192.168.136.128/sqli-labs-master/Les ...

  3. Java学习2_一些基础2_字符串_16.5.5

    接上一次的博客. 不可变字符串: Java中String类没有提供用于修改字符串的方法.如果想将greeting中的“Hello”改为“Help!”需要先提取所需要的的字符,然后再拼接.即 greet ...

  4. Intel Processor Exception Handling

    当一个进程的行为超出预期时,系统将把它kill掉. On Intel IA-32 and Intel 64 architecture processors, each architecturally- ...

  5. 网络编程基础_4.1TCP_服务端

    TCP_服务端 #include <stdio.h> // 1. 包含必要的头文件和库, 必须位于 windows之前 #include <WinSock2.h> #pragm ...

  6. Tomcat环境的搭建

    一.Tomcat的简单介绍 大家应该知道平时所说的C/S和B/S系统架构:C/S架构是基于客户端C和服务端S的,B/S架构是基于浏览器B和S服务端的,B/S架构中的server就是web服务器. To ...

  7. 01网页<head></head>常用标记及属性

    网页<head></head>常用标记及属性 <!DOCTYPE html> <html> <head> <!--网页标题--> ...

  8. Eureka组件、Eureka自我保护模式

    Eureka包含两个组件:Eureka Server和Eureka Client   Eureka Server提供服务发现的能力,各个微服务启动时,会向Eureka Server注册自己的信息(例如 ...

  9. 搭建私有docker仓库

    安装docker yum install docker 启动docker systemctl start docker 拉取registry镜像 docker pull registry 创建仓库配置 ...

  10. ubuntu中mysql忘记密码如何修改

    1.在终端进入安装目录下:cd /etc/mysql 2.sudo cat debian.cnf 输入密码 3用如下图用户和密码登录 4.进入mysql use mysql 5.使用describe ...