
Untitled
By: a guest on
May 9th, 2012 | syntax:
None | size: 1.11 KB | hits: 22 | expires: Never
Delay For Loop for a specific amount of time - Android
public void myOnClickListener(View view) {
switch (view.getId()) {
case R.id.test:
//adds two random digits to list
addRandomDigits(2);
int size = list.size();
System.out.println("Size: " + size);
tmpButton = map.get(list.get(list.size()-1));
tmpButton.setPressed(true);
tmpButton.postDelayed(new Runnable() {
public void run() {
tmpButton.setPressed(false);
}
}, 200);
Log.e("**droid", "Droid sequence: " + getArrayListAsString(list));
break;
private class myLoop extends TimerTask
{
public void run()
{
// Place your code here.
addRandomDigits(2);
int size = list.size();
System.out.println("Size: " + size);
tmpButton = map.get(list.get(list.size()-1));
tmpButton.setPressed(true);
tmpButton.setPressed(false);
Log.e("**droid", "Droid sequence: " + getArrayListAsString(list));
break;
}
}