开发者

Android Netbeans 7 Emulator not working

开发者 https://www.devze.com 2023-03-17 11:16 出处:网络
I\'m having a problem with my android emulator in Netbeans 7. Basically I\'m just making a HelloWorld project.

I'm having a problem with my android emulator in Netbeans 7. Basically I'm just making a HelloWorld project. Here is my code:

package org.me.androidapplication1;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class MainActivity 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, Android");
       setContentView(tv);
   }
}

My project uses Android 2.1-update1 (API level 7). I checked my AVD manager, and the avd I'm using has the exact same android version as my project. When I run it, the emulator pops up with this on the screen in a black background: "A N D R O I D _"

And it just stays there. No "Hello, Android" anywhere to be seen on the screen. I checked the "Android Development" tab in Netbeans, and I got these errors:

Package HelloWorld-debug.apk deployed
Starting activity org.me.androidapplication1.MainActivity on device emulator-5554
ActivityManager: DDM dispatch reg wait timeout
ActivityManager: Can't dispatch DDM chunk 52454151: no handler defined
ActivityManager: Can't dispatch DDM chunk 48454c4f: no handler defined
ActivityManager: Can't dispatc开发者_JAVA百科h DDM chunk 46454154: no handler defined
ActivityManager: Can't dispatch DDM chunk 4d505251: no handler defined
Device not ready in 3.
ActivityManager: android.util.AndroidException: Can't connect to activity manager; is the system running?

Also after a while, the emulator then shows "android", as in the logo. And then nothing happens.


Seems like the emulator had not booted totall, just wait for a while until the android desktop appears, then run your project again! I had the same problem, but when i wait enough time let A N D R O I D _ stay blinking, i finally got the desktop!

0

精彩评论

暂无评论...
验证码 换一张
取 消