我知道這個線程的標題聽起來很愚蠢,但我無法修復我的代碼。Android HelloWorld迴應
package HelloAndroid;
import android.app.Activity;
import android.os.Bundle;
import android.widget.*;
public class HelloAndroidActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView view = new TextView(this);
view.setText("LOL View Working!");
setContentView(view);
}
}
我的問題是我在模擬器收到錯誤:過程中不要reponding什麼similair。爲什麼?!這個應用程序太小了,爲什麼它不起作用?!請幫幫我。
編輯:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="HelloAndroid.Main"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="15" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".HelloAndroidActivity"
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>
代碼似乎沒什麼問題,但是你可能想僅用您需要的特定類來替換'android.widget。*'import。 – Jave 2012-02-27 10:24:17
顯示logcat的詳細信息。 – 2012-02-27 10:26:52
如果我們知道確切的錯誤,這將有所幫助。一切是否正確添加到清單? – JonWells 2012-02-27 10:27:36