这里是画了一个8
activity:
private Myview mv;
int chang=0;
private Handler handler=new Handler(){
@Override
public void handleMessage(@NonNull Message msg) {
super.handleMessage(msg);
if (msg.what==0){
mv.mathPoint(chang);
}
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initView();
}
private void initView() {
mv = (Myview) findViewById(R.id.mv);
new Thread(new Runnable() {
@Override
public void run() {
while (true){
chang++;
handler.post(new Runnable() {
@Override
public void run() {
handler.sendEmptyMessage(0);
}
});
try {