int run = 10;
@Override
public void run() {
// TODO Auto-generated method stub
try{
while( run-- > 0){
draw();
Thread.sleep(1000);
}
}catch(Exception e){
e.printStackTrace();
}
}
}
Activity 中 的onCreate(Bundle)
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}