【发布时间】:2011-09-28 17:49:53
【问题描述】:
我正在尝试使用 Eclipse 运行 Hello World 教程代码。我已经设置了 AVD,但是当我尝试运行代码时,模拟器会加载到主屏幕并且应用程序不会出现。控制台中没有显示任何错误,并且 logcat 完全为空(我也让它运行了 30 分钟)。
控制台输出:
[2011-09-28 18:00:31 - AndroidTest] ------------------------------
[2011-09-28 18:00:31 - AndroidTest] Android Launch!
[2011-09-28 18:00:31 - AndroidTest] adb is running normally.
[2011-09-28 18:00:31 - AndroidTest] Performing com.example.helloandroid.AndroidTest activity launch
[2011-09-28 18:00:31 - AndroidTest] Automatic Target Mode: launching new emulator with compatible AVD 'myAVD'
[2011-09-28 18:00:31 - AndroidTest] Launching a new emulator with Virtual Device 'myAVD'
代码:
package com.example.helloandroid;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class AndroidTest extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText("Hello World!");
setContentView(tv);
}
}
我在 Windows 7 x64 上运行。
谢谢。
【问题讨论】:
-
你有完整的清单文件吗?
-
在主屏幕可见后尝试重新运行应用程序(并且您解锁了键锁)。如果模拟器正在运行,您的应用将被部署到该模拟器上,而不是启动一个新的。
标签: android eclipse android-emulator