I found the problem while I was trying to debug the following code:
package course.examples.theanswer; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class TheAnswer extends Activity { public static final int[] answers = { 42, -10, 0, 100, 1000 }; public static final int answer = 42; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.answer_layout); TextView answerView = (TextView) findViewById(R.id.answer_view); int val = findAnswer(); String output = (val == answer) ? "42" : "We may never know"; answerView.setText("The answer to life, the universe and everything is:\n\n" + output); } private int findAnswer() { for (int val : answers) { if (val == answer) return val; } return -1; }
}
I inserted a breakpoint in the line "int val = findAnswer();" , that is, before the application executes the message ("Answer to life ..."). So, the emulator shows a white screen with a title, right, but when it goes about 10 seconds, the screen turns black ... and logCat shows the following message:
01-23 05:57:29.995: I/System.out(2009): waiting for debugger to settle... 01-23 05:57:30.205: I/System.out(2009): debugger has settled (1309) 01-23 05:57:30.845: D/dalvikvm(2009): threadid=1: still suspended after undo (sc=1 dc=1) 01-23 05:57:37.825: W/ActivityManager(1254): Launch timeout has expired, giving up wake lock! 01-23 05:57:37.835: E/WindowManager(1254): Starting window AppWindowToken{b33e2a00 token=Token{b3344b58 ActivityRecord{b317b130 u0 course.examples.theanswer/.TheAnswer t10}}} timed out
The final message is when the screen goes black. I canโt send images, but the emulator only shows: hour, network and battery. Also, if I clicked the "resumen" button, the application phishes perfectly. However, I think this is not an idea. He must stop on a white screen to debug ... (I think, but I'm not sure). This is normal?
Can anybody help me?
thanks
android debugging eclipse emulation
adrianoubk
source share