I have a custom View class which is drawing images. The problem is that when I use Thread.sleep(200); in the onDraw method, it also affects the XML elements that are in the same activity. So I have to wait 200 miliseconds untill something happens.
MainPage extends Activity implements OnClickListener{
onCreate(...){
RelativeLayout rl = (RelativeLayout) findViewById(R.id.main_rl);
rl.addView(new CustomView(this));
}
onClick(View v){
switch(v.getId){
...
};
}
}
CustomView extends View{
onDraw(){
try{
Thread.sleep(200);
....
}
}
}
Any help will be appreciated.