package com.example.applock.activity;

import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;

import androidx.appcompat.app.AppCompatActivity;

import com.example.applock.R;
import com.example.applock.allmanager.Datamanager;

public class IntoActivity extends AppCompatActivity {
 private CountDownTimer countDownTimer;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_into);
        countDownTimer = new CountDownTimer(1000,500) {
            @Override
            public void onTick(long millisUntilFinished) {

            }

            @Override
            public void onFinish() {
                intoActivity();
            }
        };
        gocount();
    }

    private void gocount() {
        countDownTimer.start();
    }
    public void intoActivity() {

            String firstkey = Datamanager.getTopKey();
            if (firstkey.isEmpty()) {
                Intent intent = new Intent(IntoActivity.this, KeyWordActivity.class);
               startActivity(intent);
            } else {
                startActivity(new Intent(IntoActivity.this, MainActivity.class));
           }
            finish();

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }

}