close

Q:

[2014-04-06 14:52:47 - HelloWord] No Launcher activity found!
[2014-04-06 14:52:47 - HelloWord] The launch will only sync the application package on the device!

Ans:

 

you need to add a package that matches your Android package name in your manifest. Right click on your src folder and New -> Package. Name it "com.example.hello". Then right click on this new package and choose New -> Class. Name this MainActivity.

MainActivity.java code

----------------------------------------------

 

package com.example.hello;

 

import android.app.Activity;

 

public class MainActivity extends Activity {

}

 

 

在檔案AndroidManifest.xml 以下放置於

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

<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="17" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >

<activity android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 = = 的頭像
    = =

    逗點大的雨滴

    = = 發表在 痞客邦 留言(0) 人氣()