The following simple code irrecoverably hangs the android emulator.
I know the first reaction is to say that it's the while(true){}. Just
remember that this is a contrived example to show the issue. In my own
code, I do the lifecycle activity as described in the docs. The issue
is that the emulator irrecoverably hangs after some time in an
infinite loop like that, whether you have break conditions or not.
I tried this with:
sdk 2.1, 2.2, and 2.3
Windows 7 64bits
Java 64 bits
Eclipse ADT
------------------------------------------------------
public class ThreadActivity extends Activity {
private Booboo mBooboo;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mBooboo = new Booboo();
mBooboo.onCreate();
}
}
public class Booboo implements Runnable {
private Thread mThread;
Booboo() {
mThread = new Thread(this,
"SceneManagerThread");
}
public void onCreate() {
Log.d("Booboo", "Thread started");
mThread.start();
}
@Override
public void run() {
while (true) {}
}
}
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en