Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 9th, 2012  |  syntax: None  |  size: 0.31 KB  |  hits: 5  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. how update a setBackground with sleep [android]?
  2. public boolean onTouch(View v,MotionEvent event){
  3. switch(event.getAction()){
  4. case MotionEvent.ACTION_UP:
  5.    button.setBackground(R.drawable.bckg1);
  6.    try{
  7.       Thread.sleep(500);
  8.       button.setBackground(R.drawable.bckg2);
  9.    }catch(Exception e){}
  10.    break;
  11. }