package com.hicorenational.antifraud.views;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.hicorenational.antifraud.MainActivity;
import com.hicorenational.antifraud.R;

import java.util.Objects;
import java.util.Timer;
import java.util.TimerTask;

/**
 * @author liuyuqi.gov@msn.cn
 * @date 4/21/2021
 */
public class SplashActivity extends AppCompatActivity {
    Context mContext;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        Objects.requireNonNull(getSupportActionBar()).hide();
        mContext = this;
        goMainActivity();
    }

    private void goMainActivity() {
        Timer timer = new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                startActivity(new Intent(mContext, MainActivity.class));
                finish();
            }
        }, 3000);
    }
}