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. 求助:可以使用任何编程工具做成一个控件或组件,使得在VB中能调用并得到摄像头的参数及图片。

    请看下网址上的这个问题,看是否有解决的方式http://www.educity.cn/wenda/338634.html

  2. (转)版本管理工具介绍——SVN篇(一)

    http://blog.csdn.net/yerenyuan_pku/article/details/72620101 SVN是何物 SVN是Subversion的简称,是一款集中式的开源版本控制系统 ...

  3. 00The C Programming Language

    The C Programming Language C语言是一门面向过程.抽象化的通用程序设计语言,广泛应用于底层开发.C语言能以简易的方式编译.处理低级存储器.C语言是仅产生少量的机器语言以及不需 ...

  4. 关于dijkstra的小根堆优化

    YY引言 在NOI2018D1T1中出现了一些很震惊的情况,D1T1可以用最短路解决,但是大部分人都在用熟知的SPFA求解最短路.而SPFA的最坏复杂度能够被卡到$O(VE)$.就是边的数量乘以点的数 ...

  5. buf.writeUInt32BE()

    buf.writeUInt32BE(value, offset[, noAssert]) buf.writeUInt32LE(value, offset[, noAssert]) value {Num ...

  6. CCF201703-1 分蛋糕 java(100分)

    试题编号: 201703-1 试题名称: 分蛋糕 时间限制: 1.0s 内存限制: 256.0MB 问题描述: 问题描述 小明今天生日,他有n块蛋糕要分给朋友们吃,这n块蛋糕(编号为1到n)的重量分别 ...

  7. Python生成随机不重复姓名昵称

    姓采用百家姓,名字从常用名字高频字选取两个汉字,再和当前时间戳组合,估计应该是不会重复了,代码如下: # -*- coding:utf-8 -*- import random import time ...

  8. vuex----mutation和action的基本使用

    我们要实现的很简单,就是点击+1的count加一,点击-1的时候count-1 一.mutation 在vue 中,只有mutation 才能改变state.  mutation 类似事件,每一个mu ...

  9. lombok 插件安装

    1. 下载地址: https://plugins.jetbrains.com/plugin/6317-lombok-plugin 2. 选择从本地安装.

  10. 如何通过js在子页面调用父页面元素的click事件

    //获取父页面的某个元素var node = window.parent.document.getElementById("btnReturn");//调用该元素的Click事件 ...