package com.github.charmasaur.alpsinsects.ui;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import com.github.charmasaur.alpsinsects.R;
import com.github.charmasaur.alpsinsects.db.FieldGuideDatabase;

public final class SplashActivity extends AppCompatActivity {
  private static final String TAG = SplashActivity.class.getSimpleName();

  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    final Handler handler = new Handler();
    // Load the database on a background thread.
    new Thread(new Runnable() {
      public void run() {
        Log.i(TAG, "Opening database.");
        FieldGuideDatabase.getInstance(getApplicationContext()).open();

        handler.postDelayed(new Runnable() {public void run() {
        Log.i(TAG, "Database opened, starting main activity.");
        Intent intent = new Intent(getApplicationContext(), MainActivity.class);
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        startActivity(intent);

        finish();
        }}, 0);
      }
    }).start();
  }
}

@@ -101,35 +101,8 @@
 le;%0A
-import android.os.Handler;%0A
 impo
@@ -146,16 +146,16 @@
 tivity;%0A
+
 import a
@@ -526,51 +526,8 @@
 );%0A%0A
-    final Handler handler = new Handler();%0A
     
@@ -747,72 +747,8 @@
 );%0A%0A
-        handler.postDelayed(new Runnable() %7Bpublic void run() %7B%0A
     
@@ -973,24 +973,24 @@
 y(intent);%0A%0A
+
         fini
@@ -999,24 +999,8 @@
 ();%0A
-        %7D%7D, 0);%0A
     

Remove unnecessary Handler in splash