
package com.hilllander.khunzohn.gpstracker;

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

import com.hilllander.khunzohn.gpstracker.util.ViewUtils;

public class WelcomeActivity extends AppCompatActivity {
    private static final long TIME = 2000;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);
        ViewUtils.setStatusBarTint(this, R.color.colorPrimaryDark);

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                Intent market = new Intent(WelcomeActivity.this, MarketingActivity.class);
                startActivity(market);
                finish();
            }
        }, TIME);
    }

    @Override
    public void onBackPressed() {
    }
}

@@ -89,42 +89,129 @@
 oid.
-os.Bundle;%0Aimport android.os.Handl
+content.SharedPreferences;%0Aimport android.os.Bundle;%0Aimport android.os.Handler;%0Aimport android.preference.PreferenceManag
 er;%0A
@@ -418,16 +418,99 @@
  = 2000;
+%0A    private static final String KEY_FIRST_APP_LAUNCH = %22key_for_first_app_launch%22;
 %0A%0A    @O
@@ -741,114 +741,411 @@
 k);%0A
-%0A        new Handler().postDelayed(new Runnable() %7B%0A            @Override%0A            public void run() %7B%0A
+        final SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);%0A        final boolean isFirstAppLaunch = sp.getBoolean(KEY_FIRST_APP_LAUNCH, true);%0A%0A        new Handler().postDelayed(new Runnable() %7B%0A            @Override%0A            public void run() %7B%0A                if (isFirstAppLaunch) %7B%0A                    sp.edit().putBoolean(KEY_FIRST_APP_LAUNCH, false).apply();%0A    
     
@@ -1247,16 +1247,20 @@
         
+    
 startAct
@@ -1290,16 +1290,20 @@
         
+    
 finish()
@@ -1300,24 +1300,227 @@
   finish();%0A
+                %7D else %7B%0A                    Intent main = new Intent(WelcomeActivity.this, MainActivity.class);%0A                    startActivity(main);%0A                    finish();%0A                %7D%0A%0A
             

store first app launch flag in shared preference