toggle view background color

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

toggle view background color

Postby avidanyum » Tue Jul 21, 2009 8:13 pm

Hi,

I have a very simple task I want to do I want to toggle a view background color, 1 second white 1 second black etc.
I tried this:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2.                 mView.setBackgroundColor(Color.WHITE);
  3.  
  4.                 mView.invalidate();
  5.  
  6.                 sleep(1000);
  7.  
  8.                 mView.setBackgroundColor(Color.BLACK);
  9.  
  10.                 mView.invalidate();
  11.  
  12.                 sleep(1000);
  13.  
  14.                 mView.setBackgroundColor(Color.WHITE);
  15.  
  16.                 mView.invalidate();
  17.  
  18.                 sleep(1000);
  19.  
  20.                 mView.setBackgroundColor(Color.BLACK);
  21.  
  22.                 mView.invalidate();
  23.  
  24.                 sleep(1000);
  25.  
  26.  
  27.  
  28.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


But it didnt work, can anyone please tell me how can I do it?

Thanks
avidanyum
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Jul 21, 2009 8:08 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 4 guests