package com.satsumasoftware.timetable.ui;

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

import com.satsumasoftware.timetable.R;
import com.satsumasoftware.timetable.TimetableApplication;
import com.satsumasoftware.timetable.framework.Timetable;

public class SplashActivity extends AppCompatActivity {

    private static final int SLEEP_TIME = 1000;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);

        Thread timer = new Thread() {
            public void run() {
                try {
                    sleep(SLEEP_TIME);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                } finally {
                    Timetable currentTimetable =
                            ((TimetableApplication) getApplication()).getCurrentTimetable();

                    Intent intent;
                    if (currentTimetable == null) {
                        intent = new Intent(getBaseContext(), TimetableEditActivity.class);
                    } else {
                        intent = new Intent(getBaseContext(), MainActivity.class);
                    }
                    startActivity(intent);
                }
            }
        };
        timer.start();
    }

    @Override
    protected void onPause() {
        super.onPause();
        finish();
    }
}

@@ -36,16 +36,45 @@
 le.ui;%0A%0A
+import android.app.Activity;%0A
 import a
@@ -387,16 +387,79 @@
 vity %7B%0A%0A
+    private static final int REQUEST_CODE_TIMETABLE_EDIT = 1;%0A%0A
     priv
@@ -1230,32 +1230,117 @@
 ctivity.class);%0A
+                        startActivityForResult(intent, REQUEST_CODE_TIMETABLE_EDIT);%0A
                 
@@ -1439,34 +1439,16 @@
 s);%0A    
-                %7D%0A
         
@@ -1482,16 +1482,72 @@
 ntent);%0A
+                        finish();%0A                    %7D%0A
         
@@ -1650,60 +1650,403 @@
 d on
-Pause() %7B%0A        super.onPause();%0A        finish();
+ActivityResult(int requestCode, int resultCode, Intent data) %7B%0A        super.onActivityResult(requestCode, resultCode, data);%0A%0A        if (requestCode == REQUEST_CODE_TIMETABLE_EDIT) %7B%0A            if (resultCode == Activity.RESULT_OK) %7B%0A                Intent intent = new Intent(this, MainActivity.class);%0A                startActivity(intent);%0A                finish();%0A            %7D%0A        %7D
 %0A   

Use startActivityForResult when creating the first Timetable