package com.example.asus.task;

import android.app.Activity;
import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

import java.util.concurrent.TimeUnit;


public class StartActivity extends Activity {
    Thread thread;

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

    }

     @Override
    protected void onStart() {

         super.onStart();

         final Activity activity = this;
        thread = (Thread)getLastNonConfigurationInstance();
         if(thread == null) {
             thread = new Thread(new Runnable() {
                 public void run() {
                     try {
                         Thread.sleep(2000);
                     } catch (InterruptedException e) {
                         e.printStackTrace();
                     }

                     runOnUiThread(
                             new Runnable() {
                                 @Override
                                 public void run() {
                                     Intent intent = new Intent(activity, MainActivity.class);
                                     startActivity(intent);
                                     activity.finish();
                                     ;
                                 }
                             });
                 }
             });
             thread.start();
         }
    }

    @Override
    public Object onRetainNonConfigurationInstance() {
        return thread;
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_start, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}

@@ -491,209 +491,78 @@
 t);%0A
-%0A    %7D%0A%0A     @Override%0A    protected void onStart() %7B%0A%0A         super.onStart();%0A%0A         final Activity activity = this;%0A        thread = (Thread)getLastNonConfigurationInstance();%0A         if(thread
+        final Activity activity = this;%0A        if (savedInstanceState
  == 
@@ -565,24 +565,27 @@
  == null) %7B%0A
+   
             
@@ -631,32 +631,35 @@
                 
+   
 public void run(
@@ -654,32 +654,35 @@
 ic void run() %7B%0A
+   
                 
@@ -713,24 +713,27 @@
             
+   
 Thread.sleep
@@ -761,16 +761,19 @@
         
+  
+ 
 %7D catch 
@@ -824,16 +824,19 @@
         
+   
 e.printS
@@ -861,35 +861,41 @@
                 
+  
+ 
 %7D%0A%0A
+   
                 
@@ -943,16 +943,19 @@
         
+  
+ 
 new Runn
@@ -992,24 +992,27 @@
             
+   
 @Override%0A  
@@ -1034,32 +1034,35 @@
                 
+  
+ 
 public void run(
@@ -1057,32 +1057,35 @@
 ic void run() %7B%0A
+   
                 
@@ -1200,16 +1200,19 @@
         
+ 
+  
 startAct
@@ -1222,24 +1222,27 @@
 ty(intent);%0A
+   
             
@@ -1322,18 +1322,24 @@
         
-;%0A
+   ;%0A   
         
@@ -1386,36 +1386,42 @@
                 
+ 
+  
 %7D);%0A
+   
                 
@@ -1428,36 +1428,42 @@
  %7D%0A             
+   
 %7D);%0A
+   
              thr
@@ -1488,17 +1488,33 @@
     
+   //
 %7D%0A    
+ 
-%7D%0A%0A
+   %7D%0A    %7D%0A%0A 
     
@@ -1532,88 +1532,156 @@
    p
-ublic Object onRetainNonConfigurationInstance() %7B
+rotected void onStart() %7B%0A%0A         super.onStart();%0A%0A
 %0A    
+%7D%0A%0A
     
-return thread;
+@Override%0A    public void onSaveInstanceState(Bundle savedInstanceState)%7B%0A
 %0A    %7D%0A%0A
 %0A   
@@ -1676,17 +1676,16 @@
 %0A    %7D%0A%0A
-%0A
     @Ove

modify state instance