画像を描画するカスタム View クラスがあります。問題は、 Thread.sleep(200); を使用するときです。onDraw メソッドでは、同じアクティビティにある XML 要素にも影響します。そのため、何かが起こるまで 200 ミリ秒待たなければなりません。
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);
....
}
}
}
どんな助けでも大歓迎です。