我正在尝试运行“HelloWorld”android 应用程序,但该应用程序未在模拟器中加载。
模拟器在主屏幕上加载正常,之后没有任何反应,感谢您的帮助。
这是控制台日志
[2011-09-18 15:37:37 - HelloWorld] Performing test.helloworld.HelloWorld activity launch
[2011-09-18 15:37:37 - HelloWorld] Performing test.helloworld.HelloWorld activity launch
[2011-09-18 15:37:37 - HelloWorld] Automatic Target Mode: launching new emulator with compatible AVD 'Test'
[2011-09-18 15:37:37 - HelloWorld] Launching a new emulator with Virtual Device 'Test'
[2011-09-18 15:37:39 - HelloWorld] New emulator found: emulator-5554
[2011-09-18 15:37:39 - HelloWorld] Waiting for HOME ('android.process.acore') to be launched...
[2011-09-18 15:38:19 - HelloWorld] WARNING: Application does not specify an API level requirement!
[2011-09-18 15:38:19 - HelloWorld] Device API version is 7 (Android 2.1)
[2011-09-18 15:38:19 - HelloWorld] HOME is up on device 'emulator-5554'
[2011-09-18 15:38:19 - HelloWorld] Uploading HelloWorld.apk onto device 'emulator-5554'
[2011-09-18 15:38:20 - HelloWorld] Installing HelloWorld.apk...
[2011-09-18 15:39:43 - HelloWorld] Success!
[2011-09-18 15:39:44 - HelloWorld] Starting activity test.helloworld.HelloWorld on device
[2011-09-18 15:39:57 - HelloWorld] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=test.helloworld/.HelloWorld }
这是代码
package test.helloworld;
public class HelloWorld 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);
}
}
更新
应用程序没有在模拟器上自动加载,但我在应用程序屏幕上找到了它。当我从 IDE 运行时,我认为应用程序会自动加载。
当我在 Emulator 上选择已安装的“HelloWorld”应用程序时,它工作正常。
从 IDE 运行时是否可以自动加载应用程序?
谢谢
最佳答案
我以前遇到过类似的问题。对我来说,有效的方法是等待主屏幕加载,然后转到应用程序屏幕。我的 HelloWorld 应用程序在该屏幕上有一个图标,我可以单击它启动它,然后它开始运行。
关于Android 模拟器不加载应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7464002/