我创建的显示的Hello World和一个按钮标有测试中,当我preSS此按钮吐司将显示一条消息,我运行在模拟器上这个程序很简单的活动。
I created very simple activity that displays hello world and a button labled TEST, when i press this button the Toast will display a message and I run this app on the emulator.
问题是,当我尝试运行此应用程序中的控制台显示了
the problem is that, when I try to run this app the console displays that
no launcher activity found
和没有到模拟器虽然code的任何错误都被显示出来。
and nothing to be displayed on the emulator although the code has no error at all.
manifest.xml的:
manifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.qr00"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".QR00"
android:label="@string/title_activity_qr00" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="QR00" />
</activity>
</application>
谁能告诉我如何解决无发射活动找到错误?
Can anyone tell me how to solve the "no launcher activity found" error?
您需要添加
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
所以:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.qr00"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".QR00"
android:label="@string/title_activity_qr00" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="QR00" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>