android studio开发
发布网友
发布时间:2022-05-20 00:14
我来回答
共1个回答
热心网友
时间:2023-10-20 21:17
private TextView textView;
private int count=5;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_ad_main);
TextView textview = (TextView) findViewById(R.id.textView);
handler.sendEmptyMessageDelayed(0,1000);
//
}
private int getCount(){
count--;
if (count==0){
startActivity(new Intent(adMainActivity.this, MainActivity.class));
finish();
}
return count;
}
private Handler handler=new Handler(){
public void handelMessage(android.os.Message msg){
if(msg.what==0){
textView.setText(getCount()+"");
handler.sendEmptyMessageDelayed(0,1000);
}
删了这个动画呢,textview每次赋值就会变的吧