简体   繁体   中英

Unable to run simple Hello World Application in Android

I am facing following problem.

[2015-06-24 20:00:57 - MyProject] No activity specified! Getting the launcher activity.
[2015-06-24 20:00:57 - MyProject] No Launcher activity found!
[2015-06-24 20:00:57 - MyProject] The launch will only sync the application package on the device!

My Manifest code is:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hello"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="14"
    android:targetSdkVersion="19" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity android:name="com.hello.FirstActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN">
            </action>      
            <category android:name="android.intent.category.LAUNCHER">
            </category>
        </intent-filter>
    </activity>
</application>

Please help as I am stuck on this since last 4 days! Thanks

Instead of

<intent-filter>
    <action android:name="android.intent.action.MAIN">
    </action>      
    <category android:name="android.intent.category.LAUNCHER">
    </category>
</intent-filter>

Use

<intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

<action> tags are self-closing tags and should be closed like this <action [...] /> .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM