lundi 29 décembre 2014

Easily debugging in Android


When I program in JavaScript, I use alert() for easy debugging. In Delphi, I change the Caption of the Form. In Android, I'm trying to do the following:



textView.setText("0");
SystemClock.sleep(2000);
textView.setText("1");
SystemClock.sleep(2000);


but I can't see the "0", as it only refreshes the screen in the end of the function (that's inside a button's onClick). All I see is the "1" after I press the button. I've read somewhere that the Invalidate is called automatically by the setText().


I tried Toast (instead of setText), it didn't work. And I want something simpler/faster than creating popups/dialogs. Any help, please?





Aucun commentaire:

Enregistrer un commentaire