Reputation: 678
I am trying to run "HelloWorld" android application, but the application doesn't load in the emulator.
Emulator loads fine with Home screen and nothing happens after that, any help is appreciated.
Here is console log
[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 }
Here is code
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);
}
}
update
app didn't load automatically on Emulator but I find it on apps screen. I thought app would load automatically when I run from IDE.
When I select the installed "HelloWorld" app on Emulator it works fine.
Is it possible to load the app automatically when it is run from the IDE?
Thanks
Upvotes: 1
Views: 7744
Reputation: 1526
It happened to me with some emulators too. After unlocking your emulator, if you still dont see your application screen, press MENU key. Then it can show up.
Upvotes: 0
Reputation: 39807
According to your log, your emulator is doing just fine. If you're not seeing anything, it would seem to be a problem with your application, not the emulator... you might try showing the source of your HelloWorld.java activity for more help, but it's likely that you're not inflating a layout to use as your application UI.
Edited to address code that was posted: You aren't creating your TextView correctly; there's more to it than what you're doing. See http://mylifewithandroid.blogspot.com/2007/12/xml-and-programmatic-layout.html for a more complete example.
Upvotes: 0
Reputation: 21
Application does not specify an API level requirement! Device API version is 7 (Android 2.1) Are you sure that emulator API match with Project API, mey be you target is 2.2 or 2.3?
Upvotes: 1
Reputation: 2342
I have had a problem similar to this before. For me what worked was waiting until the home screen loaded and then going to the apps screen. My HelloWorld app had an icon on that screen and I was able to click on it to start it and it started running at that point.
Upvotes: 1
Reputation: 5208
There aren't any error messages on the console. Everything seems to be ok. I guess you can try unlocking the phone and opening it manually.
Sometimes, the app doesn't start automatically on the emulator
Upvotes: 0