我正在测试一个简单的hello应用程序,它并未在仿真器上启动。没有错误,控制台是这样的:Android应用程序未在仿真器上启动
[2010-11-16 21:26:06 - Hello World] ------------------------------
[2010-11-16 21:26:06 - Hello World] Android Launch!
[2010-11-16 21:26:06 - Hello World] adb is running normally.
[2010-11-16 21:26:06 - Hello World] Performing com.hello.HelloWorld.HelloWorld activity launch
[2010-11-16 21:26:09 - Hello World] Launching a new emulator with Virtual Device 'VirtualDevice2.2'
模拟器启动,屏幕出现锁定,我的应用程序无法启动。
试图解锁,并去发射器寻找我的应用程序,它不存在。
任何人都可以帮助我解决这个问题吗?
谢谢。
代码:
package com.hello.HelloWorld;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class HelloWorld extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
// We want to view some very simple text, so we need a TextView
TextView tv = new TextView(this);
// Put some text to the newly created TextVIew
tv.setText("Hello Android");
// Tell our App to display the textView
this.setContentView(tv);
}
}
清单:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="1"
android:versionName="1.0" package="com.hello.HelloWorld">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".HelloWorld"
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>
<uses-sdk android:minSdkVersion="8" />
</manifest>
听起来像一个明显的问题。介意发布它? – phobos51594 2010-11-16 22:04:25
<?xml version =“1.0”encoding =“utf-8”?> intent-filter> application> –
JEagle
2010-11-16 22:12:51
您可以在发布问题时按ctrl + k来标记清单(当然包括任何xml),以避免显示空白。 – 2010-11-16 22:27:23