package org.fossasia.pslab.activity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import org.fossasia.pslab.R;

import butterknife.ButterKnife;

/**
 * Created by viveksb007 on 11/3/17.
 */

public class SplashActivity extends AppCompatActivity {

    private static int SPLASH_TIME_OUT = 2000;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash_screen);
        ButterKnife.bind(this);
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                Intent intent = new Intent(SplashActivity.this, MainActivity.class);
                startActivity(intent);
                finish();
            }
        }, SPLASH_TIME_OUT);
    }
}

@@ -422,17 +422,76 @@
 = 2000;%0A
+    private Handler handler;%0A    private Runnable runnable;
 %0A
-
     @Ove
@@ -694,16 +694,26 @@
 %0A       
+ handler =
  new Han
@@ -718,16 +718,33 @@
 andler()
+;%0A        handler
 .postDel
@@ -748,16 +748,25 @@
 Delayed(
+runnable=
 new Runn
@@ -992,16 +992,16 @@
       %7D%0A
-
         
@@ -1027,10 +1027,138 @@
 ;%0A    %7D%0A
+    @Override%0A    public void onBackPressed() %7B%0A        super.onBackPressed();%0A        handler.removeCallbacks(runnable);%0A    %7D%0A
 %7D%0A

Fix #639 app closes properly on backpress (#640)