Splash.java 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. package com.chinaappsremover.ui;
  2. import android.content.Intent;
  3. import android.os.Bundle;
  4. import android.os.Handler;
  5. import androidx.appcompat.app.ActionBar;
  6. import androidx.appcompat.app.AppCompatActivity;
  7. import com.chinaappsremover.R;
  8. import com.chinaappsremover.dbhandler.DbUtils;
  9. public class Splash extends AppCompatActivity {
  10. protected void onCreate(Bundle bundle) {
  11. super.onCreate(bundle);
  12. setContentView(R.layout.activity_splash);
  13. ActionBar supportActionBar = getSupportActionBar();
  14. if (supportActionBar != null) {
  15. supportActionBar.hide();
  16. }
  17. DbUtils.attachDB(this);
  18. new Handler().postDelayed(new Runnable() {
  19. public void run() {
  20. Splash splash = Splash.this;
  21. splash.startActivity(new Intent(splash, MainActivity.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK));
  22. Splash.this.finish();
  23. }
  24. }, 2500);
  25. }
  26. }