安卓开发日记40

写进入界面跳转后端代码

package com.example.myexamproject;


import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.Window;

import com.example.myexamproject.R;

public class WelcomeActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_welcome);
Handler handler = new Handler();
//当计时结束,跳转至主界面
handler.postDelayed(new Runnable() {
@Override
public void run() {
Intent intent = new Intent(WelcomeActivity.this, LoginActivity.class);
startActivity(intent);
WelcomeActivity.this.finish();
}
}, 3000);
}
}
posted @ 2024-05-24 10:06  大虚胖子  阅读(2)  评论(0编辑  收藏  举报