|
|
|
@ -6,6 +6,7 @@ import android.os.Handler;
|
|
|
|
|
import androidx.appcompat.app.AppCompatActivity;
|
|
|
|
|
import net.micode.notes.R;
|
|
|
|
|
|
|
|
|
|
//该类实现了一个简单的启动屏幕(Splash Screen),用于在应用程序启动时显示,并在2秒后跳转到NotesListActivity。
|
|
|
|
|
public class SplashActivity extends AppCompatActivity {
|
|
|
|
|
Handler mHandler=new Handler();// 用于在一定延迟后执行代码
|
|
|
|
|
@Override
|
|
|
|
@ -17,7 +18,7 @@ public class SplashActivity extends AppCompatActivity {
|
|
|
|
|
mHandler.postDelayed(new Runnable() {
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
Intent intent=new Intent();//用于启动新的 Activity,这里创建了一个新的 Intent将其 Class 设置为 LoginActivity.class
|
|
|
|
|
Intent intent=new Intent();//用于启动新的 Activity,这里创建了一个新的 Intent将其 Class 设置为 NotesListActivity.class
|
|
|
|
|
intent.setClass(SplashActivity.this, NotesListActivity.class);
|
|
|
|
|
startActivity(intent);//使用 Intent 启动新的 Activity
|
|
|
|
|
finish(); //销毁欢迎页面
|
|
|
|
|