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一系列初始 ...
随机推荐
- dedecms手机网站内页上一篇/下一篇的翻页功能
修改文件include/arc.archives.class.php文件. 1.搜索 function GetPreNext($gtype='') 2.将这个函数的所有内容替换为 function G ...
- JDBC使用游标实现分页查询的方法
本文实例讲述了JDBC使用游标实现分页查询的方法.分享给大家供大家参考,具体如下: /** * 一次只从数据库中查询最大maxCount条记录 * @param sql 传入的sql语句 * @par ...
- codeforces_459D_(线段树,离散化,求逆序数)
链接:http://codeforces.com/problemset/problem/459/D D. Pashmak and Parmida's problem time limit per te ...
- nginx_gzip压缩提升网站的传输速度
gzip on; gzip_min_length 1k; gzip_buffers 16k; #gzip_http_version 1.0; gzip_comp_level ; gzip_types ...
- java虚拟机(七)--java内存模型JMM
本文参考慕课网相关视频和博客https://mp.weixin.qq.com/s/tV0MfDdJqGwGMHCIkqnAgA,图也是这个博客的,这篇只是自己的简单总结,想要深 入理解可以访问这两块内 ...
- css 实现垂直居中
通用 代码: 1 2 3 4 <div id="parent"> <div id="floater"></div> < ...
- mac 中查看监听程序
sudo lsof -nP -iTCP -sTCP:LISTEN | grep mysql
- array copy rotate in Pointwise
goal: # # Copyright 2010 (c) Pointwise, Inc. # All rights reserved. # # This sample Pointwise script ...
- Python基础—面向对象(初级篇)
一.什么是面向对象编程 面向对象编程(Object Oriented Programming,OOP,面向对象程序设计),python语言比较灵活即支持面向对象编程也支持面向函数式编程. 面向过程编程 ...
- String replaceAll 正则注意事项及特殊用法(xjl456852原创)
我们知道String replaceAll(参数a, 参数b) 参数a是需要些正则表达式的. 但是今天试了试,发现参数b也有一些其它特性. 查看源码后,发现有些特性是平时不怎么用的.下面我来介绍一下这 ...