Error处理: 重提No Launcher activity found!
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>中。
----------------------------------
Error处理: 重提No Launcher activity found!的更多相关文章
- android编程常见问题-No Launcher activity found!
新手编程常见的问题: 问题表现: console提示:No Launcher activity found! The launch will only sync the application pac ...
- android 初学: 提示No Launcher activity found!
提示No Launcher activity found! 三步检查: 1 必须有 <category android:name="android.intent.category.LA ...
- Launcher Activity在开机时重新启动两次解决的方法
今天在看log的时候发现,Launcher activity会被onDestroy掉一次.然后再重新启动. 可能原因推測: 1.横竖屏切换 2.MCC MNC等Configuration改变引起的 M ...
- No Launcher activity found!
已经研究Android有几天了,刚开始写的代码说安装成功,但是在AVD没有显示.左看代码,右看代码,总是没找到错误, <application android:allowBackup=" ...
- android开发出现No Launcher activity found!解决方案
在AndroidManifest.xml中的中少了这段代码 <activity android:name=".MainActivity" android:label=&quo ...
- Error in Android Studio - "Default Activity Not Found"
Make sure you have specified the default activity in your AndroidManisfest.xml file. Within your def ...
- Android更改桌面应用程序launcher的两种方式
http://blog.csdn.net/mdx20072419/article/details/9632779/ launcher,也就是android的桌面应用程序.下图是我正在使用的魅族手机的l ...
- Installation error: INSTALL_FAILED_UPDATE_INCOMPATIBLE
Installation error: INSTALL_FAILED_UPDATE_INCOMPATIBLE 晚上在测一个widget,前面测的好好的,后面再安装的时候发现如下错误:[2009-06- ...
- android M Launcher之LauncherModel (二)
上一篇我们通过LauncherModel的创建 ,实例化,以及与LauncherModel之间的沟通方式.初步了解了LauncherModel一些功能及用法,如果对LauncherModel一系列初始 ...
随机推荐
- canvas一周一练 -- canvas绘制奥运五环(1)
运行效果: <!DOCTYPE html> <html> <head> </head> <body> <canvas id=" ...
- VS2015 安装包缺失(联网安装失败)问题解决
Win7 x86 测试可行 * 如果前面有尝试过安装不成功, 一定要用卸载程序删除已安装的部分,否则会出乱子. 1. 或者是用虚拟光驱加载ISO, 或者是解压到硬盘上, 都没有关系. 2. 用管理员 ...
- Mac上简单常用Terminal命令
方案1 SSH是一个非常伟大的工具,如果你要在互联网上远程连接到服务器,那么SSH无疑是最佳的候选.SSH是加密的,OpenSSH加密所有通信(包括密码),有效消除了窃听,连接劫持和其它攻击.本文将为 ...
- SDK_列表控件的使用
列表控件的使用 列表控件是通用控件,响应WM_NOTIFY 消息 主要包含了 4 种风格,我们学的是 report 风格 如何设置列表的扩展风格 LVS_EX_GRIDLINES: 列表拥有表格线 L ...
- CAD使用GetXData读数据(com接口)
主要用到函数说明: MxDrawEntity::GetXData 返回实体的扩展数据. c#代码实现如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 ...
- 16Log4J
Log4J Log4j是Apache的一个开放源代码项目,通过使用Log4j,我们可以控制日志信息输送的目的地是控制台.文件.GUI组件.甚至是套接口服务器.NT的事件记录器.UNIX Syslog守 ...
- linux运行jar报错
通过maven打jar包,然后复制到虚拟机上执行nohup java -jar xxx.jar &命令,运行jar文件,这时抛出了异常 com.mysql.jdbc.exceptions.jd ...
- language support图标消失
在控制台下输入sudo apt-get install language-selector-gnome即可
- stall and flow separation on airfoil or blade
stall stall and flow separation Table of Contents 1. Stall and flow separation 1.1. Separation of Bo ...
- FJoi2017 1月21日模拟赛 comparison(平衡树+thita重构)
题目大意: 经黄学长指出,此题原题出自2014湖北省队互测 没有人的算术 规定集合由二元组(A,B)构成,A.B同时也是两个这样的集合,即A.B本身也是二元组 规定二元组S为严格最小集合,S=(S,S ...