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. 面试中的一些小问题之ES5和ES6的区别?

    1995年,JavaScript作为网景浏览器的一部分首次发布,起初并不叫JavaScript,而是叫LiveScript,但是因为当时Java正火,也算是为了搭上java的顺风车,于是改成了Java ...

  2. 读《An Adaptable and Extensible Geometry Kernel》

    读<An Adaptable and Extensible Geometry Kernel> 利用Curiously Recurring Template Pattern替代虚函数 详细内 ...

  3. Protocol(协议)

    Protocol(协议) (一) (1)简介 1.Protocol:就一个用途,用来声明一大堆的方法(不能声明成员变量),不能写实现.看起来类似于一个类的接口, 不同的是协议没有父类,也不能定义实例变 ...

  4. vue学习图解

    vue2.0版本的学习图解个人心得!本文为原创禁止转载!!转载需要注明出处,谢谢合作!!!

  5. GPC:使用GPC计算intersection容易出现的问题

    在使用GPC计算多边形的交的时候,出现问题 //1.2. 另一种方法,判断新的多边形是否和老多边形相交     Poly cross = (PolyDefault) Clip.intersection ...

  6. putty源码阅读----plink

    一直对ssh协议的各种客户端实现比较入迷,遍寻了很多ssh协议实现也用了很多的库,发现依赖太多 putty是最纯洁依赖第三方几乎为0的客户端实现,先从plink处开始入手. 1.putty目录 才刚开 ...

  7. Vue组件传值方法调用

    1.子组件改变父组件的值 <father  label="云盘快照" name="name2"> <son :props='rows'   @ ...

  8. C++/C union使用记一下锅

    //首先,学习编程一定要记得加几个群或者加几个讨论组,因为这样你才能不断地进步还有吵架/滑稽 记一下 关于使用union结构体时遇到的一些坑 To zero-initialize an object ...

  9. UVA - 1608 Non-boring sequences(分治法)

    题目: 如果一个序列的任意连续的子序列中至少有一个只出现一次的元素,则称这个序列是不无聊的.输入一个n(n≤200000)个元素的序列A(各个元素均为109以内的非负整数),判断它是不是不无聊的. 思 ...

  10. type、object、class之间的关系

    class Foo: pass print(type(int)) # <class 'type'> print(type(str)) # <class 'type'> prin ...