Change the TextView color Continuosly using UIThread

Have a nice day. Now i write the code for changing the textview continuosly using UIThread.

Just try out.

handler = new Handler();
new Thread(new Runnable() {

public void run() {
final int totalCount=1000;
// TODO Auto-generated method stub
for(int i=0;i<totalCount;i++){
try {
runOnUiThread(new Runnable() {
                       public void run() {                        
                        Random r = new Random();
    r.nextInt(256), r.nextInt(256)));                          

} catch (InterruptedException e) {
// TODO Auto-generated catch block


Textview is continuously changing the textcolor. I'm set the 1000 milliseconds (1 Second). 


Popular posts from this blog

Clear the app data programmatically in android

convert an integer to a string in java

Print the large string values in android log cat.