Subversion Repositories SmartDukaan

Rev

Rev 22381 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
21480 rajender 1
package com.saholic.profittill;
2
 
3
import android.Manifest;
4
import android.app.AlertDialog;
22834 rajender 5
import android.app.FragmentManager;
21480 rajender 6
import android.app.ProgressDialog;
7
import android.content.Context;
8
import android.content.DialogInterface;
9
import android.content.Intent;
10
import android.content.SharedPreferences;
22834 rajender 11
import android.content.pm.PackageInfo;
21480 rajender 12
import android.content.pm.PackageManager;
13
import android.net.ConnectivityManager;
14
import android.net.Uri;
15
import android.os.AsyncTask;
16
import android.os.Build;
17
import android.os.Bundle;
18
import android.support.annotation.NonNull;
19
import android.support.v4.app.ActivityCompat;
20
import android.support.v4.content.ContextCompat;
21
import android.support.v7.app.ActionBarActivity;
22834 rajender 22
import android.support.v7.app.AppCompatActivity;
21480 rajender 23
import android.telephony.TelephonyManager;
24
import android.util.Log;
25
import android.view.Menu;
26
import android.view.MenuItem;
22834 rajender 27
import android.view.View;
28
import android.view.ViewGroup;
21480 rajender 29
import android.widget.ProgressBar;
30
import android.widget.Toast;
31
 
32
import com.google.android.gms.analytics.HitBuilders;
33
import com.google.android.gms.analytics.Tracker;
34
import com.google.android.gms.common.ConnectionResult;
35
import com.google.android.gms.common.api.GoogleApiClient;
22834 rajender 36
import com.google.android.gms.plus.Plus;
21480 rajender 37
import com.google.firebase.iid.FirebaseInstanceId;
38
import com.saholic.profittill.Constants.ProfitTillConstants;
39
import com.saholic.profittill.Utils.UtilityFunctions;
22834 rajender 40
import com.saholic.profittill.main.DealsHomeFragment;
21480 rajender 41
import com.saholic.profittill.main.GoogleAnalyticsTracker;
22834 rajender 42
import com.saholic.profittill.main.HowItWorks;
21480 rajender 43
import com.saholic.profittill.main.LoginActivity;
44
import com.saholic.profittill.main.MainActivity;
22834 rajender 45
import com.saholic.profittill.main.ScreenActivity;
21480 rajender 46
import com.testin.agent.TestinAgent;
47
 
48
import org.apache.http.HttpEntity;
49
import org.apache.http.HttpResponse;
50
import org.apache.http.NameValuePair;
51
import org.apache.http.client.HttpClient;
52
import org.apache.http.client.entity.UrlEncodedFormEntity;
53
import org.apache.http.client.methods.HttpPost;
54
import org.apache.http.impl.client.DefaultHttpClient;
55
import org.apache.http.message.BasicNameValuePair;
56
import org.apache.http.util.EntityUtils;
57
import org.json.JSONArray;
58
import org.json.JSONObject;
59
 
60
import java.util.ArrayList;
61
 
62
 
63
public class SplashScreen extends ActionBarActivity implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener{
64
    SharedPreferences apiData, userData, apkData;
65
    SharedPreferences.Editor apiEditor, userEditor, apkDataEditor,userDataEditor;
66
    UtilityFunctions utilityFunctions;
67
    AlertDialog dialog1;
22834 rajender 68
    public GoogleApiClient mGoogleApiClient;
21480 rajender 69
    AlertDialog.Builder b;
70
    ProgressBar pd;
22834 rajender 71
    Context c;
72
    String type1;
21480 rajender 73
    FirebaseInstanceId fcm;
74
    String regId;
75
    ArrayList<NameValuePair> apkDataListValue;
76
    ArrayList<NameValuePair> nameValuePairsGcm;
77
    public static final int READ_PHONE_STATE_PERMISSION = 100;
78
    private boolean PermissionIngranted=false;
79
    @Override
80
    protected void onCreate(Bundle savedInstanceState) {
81
        TestinAgent.init(this);
82
        super.onCreate(savedInstanceState);
83
        setContentView(R.layout.activity_splash_screen);
22834 rajender 84
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
85
            getSupportActionBar().hide();
86
        }
22133 rajender 87
        GIFView gifImageView = (GIFView) findViewById(R.id.gif);
88
        gifImageView.setGifImageResource(R.drawable.progressbar);
21480 rajender 89
        userData = getApplicationContext().getSharedPreferences("User_Data", MODE_PRIVATE);
90
        apkData = getApplicationContext().getSharedPreferences("APK_Data", MODE_PRIVATE);
91
        apiData = getApplicationContext().getSharedPreferences("API_Data", MODE_PRIVATE);
92
        apkDataEditor = apkData.edit();
22834 rajender 93
        userDataEditor = userData.edit();
21480 rajender 94
        apiEditor = apiData.edit();
22834 rajender 95
 
21480 rajender 96
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
97
            requestPermissions(new String[]{Manifest.permission.READ_PHONE_STATE}, READ_PHONE_STATE_PERMISSION);
98
        }
99
        else{
100
            PermissionIngranted=true;
101
        }
22834 rajender 102
 
103
        type1 = userData.getString("type", null);
104
        if (type1 != null && type1.equalsIgnoreCase("google")) {
105
            mGoogleApiClient = new GoogleApiClient.Builder(SplashScreen.this)
106
                    .addConnectionCallbacks(this)
107
                    .addOnConnectionFailedListener(this).addApi(Plus.API)
108
                    .addScope(Plus.SCOPE_PLUS_LOGIN).build();
109
            mGoogleApiClient.connect();
110
        }
21480 rajender 111
        String url = "";
112
        Tracker t = ((GoogleAnalyticsTracker) getApplicationContext()).getTracker(
113
                GoogleAnalyticsTracker.TrackerName.APP_TRACKER);
114
        t.setScreenName("Splash Screen");
115
        t.send(new HitBuilders.ScreenViewBuilder().build());
116
        try {
117
            String apkVersionCode = apkData.getString("versionCode","");
118
            String apkVersionName = apkData.getString("versionName","");
119
            if(userData.getString("id","").isEmpty()) {
120
 
121
            }else {
122
                if (apkVersionCode.isEmpty()) {
123
                    utilityFunctions=new UtilityFunctions();
124
                    apkDataListValue = utilityFunctions.getDeviceInformation(this);
125
 
126
                    if(isInternetOn()) {
127
                        new pushApkData().execute();
128
                    }
129
                } else if (!(apkData.getString("checkId","blank").equalsIgnoreCase(userData.getString("id","blank")))) {
130
                    utilityFunctions=new UtilityFunctions();
131
                    apkDataListValue = utilityFunctions.getDeviceInformation(this);
132
                    if(isInternetOn()) {
133
                        new pushApkData().execute();
134
                    }
135
                } else if (Integer.parseInt(apkVersionCode) == getPackageManager().getPackageInfo(getPackageName(), 0).versionCode) {
136
 
137
                }  else {
138
                    utilityFunctions=new UtilityFunctions();
139
                    apkDataListValue = utilityFunctions.getDeviceInformation(this);
140
                    if(isInternetOn()) {
141
                        new pushApkData().execute();
142
                    }
143
                }
144
            }
145
        }catch (Exception e){
146
            e.printStackTrace();
147
        }
148
        if(isInternetOn()){
149
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
150
                requestphoneUpdates();
151
            }
152
            else{
153
                    new fetchAPISettings().execute();
154
                }
155
        }
156
        else{
157
            b= new AlertDialog.Builder(this);
22381 rajender 158
            b.setIcon(R.drawable.interet);
159
            b.setTitle("No Internet Connection");
21480 rajender 160
            b.setMessage("No internet connection. Please try again.");
161
            b.setCancelable(false);
162
            b.setPositiveButton("Retry", new DialogInterface.OnClickListener()
163
            {
164
                @Override
165
                public void onClick(DialogInterface dialog, int which) {
166
                    if(isInternetOn()){
167
                        new fetchAPISettings().execute();
168
                        dialog1.dismiss();
169
                    }
170
                    else{
171
                        dialog1 = b.create();
172
                        dialog1.show();
173
                    }
174
                }
175
 
176
            });
177
            b.setNegativeButton("No", new DialogInterface.OnClickListener() {
178
                @Override
179
                public void onClick(DialogInterface dialog, int which) {
180
                    finish();
181
 
182
                }
183
            });
184
            dialog1 = b.create();
185
            dialog1.show();
186
        }
187
    }
188
 
189
 
22834 rajender 190
    private int getFirstTimeRun() throws PackageManager.NameNotFoundException {
191
        SharedPreferences appPreferences = getSharedPreferences("MyAPP", 0);
192
        int appCurrentBuildVersion = BuildConfig.VERSION_CODE;
193
        int appLastBuildVersion = appPreferences.getInt("app_first_time", 0);
21480 rajender 194
 
22834 rajender 195
        if (appLastBuildVersion == appCurrentBuildVersion ) {
196
            final String idCheck = userData.getString("id", null);
197
 
198
            if(idCheck != null){
199
                Intent startActivityIntent=new Intent(SplashScreen.this, MainActivity.class);
200
                Intent intent = getIntent();
201
                if (Intent.ACTION_VIEW.equals(intent.getAction())) {
202
                    Uri uri = intent.getData();
203
                    startActivityIntent.setAction("31");
204
                    startActivityIntent.setData(Uri.parse(uri.toString()));
205
                }
206
                startActivity(startActivityIntent);
207
            }
208
            else{
209
                Intent startActivityIntent=new Intent(SplashScreen.this,LoginActivity   .class);
210
                Intent intent = getIntent();
211
                if (Intent.ACTION_VIEW.equals(intent.getAction())) {
212
                    Uri uri = intent.getData();
213
                    startActivityIntent.setAction("31");
214
                    startActivityIntent.setData(Uri.parse(uri.toString()));
215
                }
216
                startActivity(startActivityIntent);
217
            }
218
            return 1;
219
        }
220
 
221
        else {
222
            appPreferences.edit().putInt("app_first_time",
223
                    appCurrentBuildVersion).apply();
224
            if (appLastBuildVersion == 0) {
225
                Intent startActivityIntent=new Intent(SplashScreen.this,  ScreenActivity.class);
226
                startActivity(startActivityIntent);
227
 
228
                }
229
            else {
230
                try{
231
                    if (mGoogleApiClient.isConnected()) {
232
                        Plus.AccountApi.clearDefaultAccount(mGoogleApiClient);
233
                        mGoogleApiClient.disconnect();
234
                        mGoogleApiClient.connect();
235
                        userDataEditor.clear().commit();
236
                        startActivity(new Intent(SplashScreen.this,LoginActivity.class));
237
                    }
238
                    else{
239
                        if(!mGoogleApiClient.isConnected()){
240
                            userDataEditor.clear().commit();
241
                            startActivity(new Intent(SplashScreen.this, LoginActivity.class));
242
                        }
243
 
244
                    }
245
                }catch (Exception e){
246
                    userDataEditor.clear().commit();
247
                    startActivity(new Intent(SplashScreen.this, LoginActivity.class));
248
                }
249
            }
250
        }
251
        return 2;
252
    }
253
 
254
    @Override
255
    public Intent getIntent() {
256
        return super.getIntent();
257
    }
258
 
259
    @Override
260
    public void setContentView(View view, ViewGroup.LayoutParams params) {
261
        super.setContentView(view, params);
262
    }
263
 
264
    public SplashScreen() {
265
        super();
266
    }
267
 
268
    public void requestphoneUpdates(){
269
 
21480 rajender 270
      if (ContextCompat.checkSelfPermission(SplashScreen.this,
271
              Manifest.permission.READ_PHONE_STATE)
272
              != PackageManager.PERMISSION_GRANTED) {
273
          if (ActivityCompat.shouldShowRequestPermissionRationale(SplashScreen.this,
274
                  Manifest.permission.READ_PHONE_STATE)) {
275
 
276
          } else {
277
              ActivityCompat.requestPermissions(SplashScreen.this,
278
                      new String[]{Manifest.permission.READ_PHONE_STATE},
279
                      READ_PHONE_STATE_PERMISSION);
280
          }
281
          return;
282
      }
283
  }
284
    @Override
285
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
286
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
287
        switch (requestCode){
288
 
289
            case READ_PHONE_STATE_PERMISSION:
290
                try {
291
                    if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
292
                        PermissionIngranted = true;
293
 
294
                        if(isInternetOn()) {
295
                              new fetchAPISettings().execute();
296
 
297
        } else {
298
                b = new AlertDialog.Builder(this);
22381 rajender 299
                b.setIcon(R.drawable.interet);
300
                b.setTitle("No Internet Connection");
21480 rajender 301
                b.setMessage("No internet connection. Please try again.");
302
                b.setCancelable(false);
303
                b.setPositiveButton("Retry", new DialogInterface.OnClickListener() {
304
                    @Override
305
                    public void onClick(DialogInterface dialog, int which) {
306
                        if (isInternetOn()) {
307
                            new fetchAPISettings().execute();
308
                            dialog1.dismiss();
309
                        } else {
310
                            dialog1 = b.create();
311
                            dialog1.show();
312
                        }
313
                    }
314
 
315
                });
316
        b.setNegativeButton("No", new DialogInterface.OnClickListener() {
317
            @Override
318
            public void onClick(DialogInterface dialog, int which) {
319
                finish();
320
 
321
            }
322
        });
323
        dialog1 = b.create();
324
        dialog1.show();
325
    }}
326
        else {
22834 rajender 327
         // Toast.makeText(getApplicationContext(),"Permission is required to enter in application",Toast.LENGTH_LONG).show();
21480 rajender 328
            PermissionIngranted = false;
329
        }
330
    }
331
    catch (Exception e){
332
        e.printStackTrace();
333
    }
334
 
335
         break;
336
        }
337
 
338
    }
339
 
340
    @Override
341
    public boolean onCreateOptionsMenu(Menu menu) {
342
        getMenuInflater().inflate(R.menu.menu_splash_screen, menu);
343
        return true;
344
    }
345
 
346
    @Override
347
    public boolean onOptionsItemSelected(MenuItem item) {
348
        int id = item.getItemId();
349
        if (id == R.id.action_settings) {
350
            return true;
351
        }
352
 
353
        return super.onOptionsItemSelected(item);
354
    }
355
 
356
    @Override
357
    public void onConnected(Bundle bundle) {
358
     requestphoneUpdates();
359
    }
360
 
361
    @Override
362
    public void onConnectionSuspended(int i) {
363
 
364
    }
365
 
366
    @Override
367
    public void onConnectionFailed(ConnectionResult connectionResult) {
368
 
369
    }
370
 
371
    class fetchAPISettings extends AsyncTask<String, Integer, JSONObject> {
372
 
373
        @Override
374
        protected void onPreExecute() {
375
            super.onPreExecute();
376
        }
377
 
378
        @Override
379
        protected JSONObject doInBackground(String... arg0) {
380
            try {
381
 
382
                TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
383
                HttpClient httpclient = new DefaultHttpClient();
384
                String url = ProfitTillConstants.MOBILE_API+"?t="+apkData.getString("timestamp","0")+"&imeinumber="+telephonyManager.getDeviceId();
385
                HttpPost httppost=new HttpPost(url);
386
                httppost.setHeader("Authorization", ProfitTillConstants.BASIC_AUTH);
387
                HttpResponse response = httpclient.execute(httppost);
388
                HttpEntity entity = response.getEntity();
389
                JSONObject jObjGmail = new JSONObject(EntityUtils.toString(entity));
390
                return jObjGmail;
391
 
22834 rajender 392
            }
393
            catch(Exception e) {
21480 rajender 394
                e.printStackTrace();
395
                return null;
396
 
397
            }
398
 
399
        }
400
        @Override
401
        protected void onPostExecute(JSONObject result) {
402
            super.onPostExecute(result);
403
            if(result==null){
404
                finish();
405
            }
406
            try {
407
               JSONArray objects = result.getJSONArray("settings");
408
                if(objects.length()==0){
409
                    System.out.println("Null settings array");
410
                }else {
411
                    for (int i = 0; i < objects.length(); i++) {
412
                        JSONObject jsonObject = objects.getJSONObject(i);
413
                        JSONObject j = jsonObject.getJSONObject("Mobileappsetting");
414
                        apiEditor.remove(j.getString("setting"));
415
                        apiEditor.commit();
416
                        apiEditor.putString(j.getString("setting"), j.getString("value"));
417
                        apiEditor.commit();
418
                    }
419
                }
420
                String timestamp=result.getString("t");
421
                String failureCount=result.getString("failureCount");
422
                apkDataEditor.putString("timestamp",timestamp);
423
                apkDataEditor.commit();
22834 rajender 424
                getFirstTimeRun();
21480 rajender 425
 
426
            }catch (Exception e){
427
                finish();
428
            }
429
        }
430
    }
431
 
432
    class pushApkData extends AsyncTask<String, Integer, String> {
433
 
434
        @Override
435
        protected void onPreExecute() {
436
            super.onPreExecute();
437
        }
438
 
439
        @Override
440
        protected String doInBackground(String... arg0) {
441
            try {
442
                HttpClient httpclient = new DefaultHttpClient();
22834 rajender 443
                HttpPost httppost = new HttpPost(apiData.getString("devices_info","http://api.profittill.com/devices/add"));
22133 rajender 444
                //HttpPost httppost = new HttpPost(ProfitTillConstants.Push_Url);
21480 rajender 445
                httppost.setHeader("Authorization", ProfitTillConstants.BASIC_AUTH);
446
                httppost.setEntity(new UrlEncodedFormEntity(apkDataListValue));
447
                HttpResponse response = httpclient.execute(httppost);
448
                HttpEntity entity = response.getEntity();
449
                int status = response.getStatusLine().getStatusCode();
450
 
451
                if(status == 200){
452
                    apkDataEditor.putString("checkId",userData.getString("id",""));
453
                    apkDataEditor.commit();
454
                    return "success";
455
                } else {
456
                    return "failure";
457
                }
458
 
459
            } catch (Exception e) {
460
                return null;
461
 
462
            }
463
 
464
        }
465
        @Override
466
        protected void onPostExecute(String result) {
467
            super.onPostExecute(result);
22133 rajender 468
        }
21480 rajender 469
    }
470
 
471
 
472
    public final boolean isInternetOn() {
473
 
474
        ConnectivityManager connection =
475
                (ConnectivityManager)getSystemService(this.getBaseContext().CONNECTIVITY_SERVICE);
476
 
477
        if (    connection.getNetworkInfo(0).getState() == android.net.NetworkInfo.State.CONNECTED ||
478
                connection.getNetworkInfo(1).getState() == android.net.NetworkInfo.State.CONNECTED ) {
479
            return true;
480
 
481
        } else if (
482
                connection.getNetworkInfo(0).getState() == android.net.NetworkInfo.State.CONNECTING ||
483
                        connection.getNetworkInfo(1).getState() == android.net.NetworkInfo.State.CONNECTING ||
484
                connection.getNetworkInfo(0).getState() == android.net.NetworkInfo.State.DISCONNECTED ||
485
                        connection.getNetworkInfo(1).getState() == android.net.NetworkInfo.State.DISCONNECTED  ) {
486
            return false;
487
        }
488
        return false;
489
    }
490
 
491
    ProgressDialog pDlg;
492
 
493
    public void registerGCM() {
494
 
495
        registerInBackground();
496
 
497
    }
498
 
499
    private void registerInBackground() {
500
        new AsyncTask<Void, Void, String>() {
501
            @Override
502
            protected String doInBackground(Void... params) {
503
                String msg = "";
504
                if (fcm == null) {
505
                    regId = FirebaseInstanceId.getInstance().getToken();
506
                    msg = "Device registered";
507
                }
508
                return msg;
509
            }
510
 
511
            @Override
512
            protected void onPostExecute(String msg) {
513
                if(userData.getString("fcm_token_sent","false").equalsIgnoreCase("false")) {
514
                    new gcmPushData().execute(msg);
515
                }
516
            }
517
        }.execute(null, null, null);
518
    }
519
 
520
 
521
    class gcmPushData extends AsyncTask<String, Integer, String> {
522
 
523
        @Override
524
        protected void onPreExecute() {
525
            super.onPreExecute();
526
        }
527
 
528
        @Override
529
        protected String doInBackground(String... arg0) {
530
            String id = null;
531
            try {
532
                HttpClient httpclient = new DefaultHttpClient();
533
                HttpPost httppost = new HttpPost(apiData.getString("gcm.push.url", "http://api.profittill.com/gcm_users/add"));
22133 rajender 534
                //HttpPost httppost = new HttpPost(ProfitTillConstants.gcm_url);
21480 rajender 535
                nameValuePairsGcm = new ArrayList<>();
536
                TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
537
                nameValuePairsGcm.add(new BasicNameValuePair("gcm_regid", regId));
538
                nameValuePairsGcm.add(new BasicNameValuePair("imeinumber", telephonyManager.getDeviceId()));
539
                nameValuePairsGcm.add(new BasicNameValuePair("user_id", userData.getString("id", null)));
540
                nameValuePairsGcm.add(new BasicNameValuePair("device_message", arg0[0]));
541
                nameValuePairsGcm.add(new BasicNameValuePair("notification_type","fcm"));
542
                nameValuePairsGcm.add(new BasicNameValuePair("androidid", UtilityFunctions.androidId(SplashScreen.this)));
543
                httppost.setHeader("Authorization", ProfitTillConstants.BASIC_AUTH);
544
                httppost.setEntity(new UrlEncodedFormEntity(nameValuePairsGcm));
545
                HttpResponse response = httpclient.execute(httppost);
546
                HttpEntity entity = response.getEntity();
547
                int status = response.getStatusLine().getStatusCode();
548
 
549
                if(status == 200){
550
                    Log.d("ResponseCode GCM ",status+"");
551
                    userDataEditor.putString("fcm_token_sent", "true");
552
                    userDataEditor.commit();
553
                } else {
554
                    Log.d("ResponseCode GCM ",status+"");
555
                }
556
 
557
                nameValuePairsGcm.clear();
558
                Log.e("pass 1", "connection success ");
559
            } catch (Exception e) {
560
                Log.e("Fail 1", e.toString());
561
 
562
            }
563
            return id;
564
        }
565
 
566
 
567
        @Override
568
        protected void onPostExecute(String result) {
569
            super.onPostExecute(result);
570
            final String idCheck = userData.getString("id",null);
571
          /*  if(userData.getString("docsSubmitted","false").equalsIgnoreCase("true")){
572
                Intent i = new Intent(SplashScreen.this, PendingActivity.class);
573
                startActivity(i);
574
            }
575
         else if (userData.getString("referralCodeRequired", "false").equalsIgnoreCase("true")) {
576
                Intent startActivityIntent=new Intent(SplashScreen.this, BasicInformation.class);
577
                Intent intent = getIntent();
578
                if (Intent.ACTION_VIEW.equals(intent.getAction())) {
579
                    Uri uri = intent.getData();
580
                    startActivityIntent.setAction("31");
581
                    startActivityIntent.setData(Uri.parse(uri.toString()));
582
                }
583
                startActivity(startActivityIntent);
584
                //startActivity(new Intent(SplashScreen.this, ReferrerActivity.class));
585
            }
586
            else if (userData.getString("message", "false").equalsIgnoreCase("true")) {
587
                Intent startActivityIntent=new Intent(SplashScreen.this, MobileNumber.class);
588
                Intent intent = getIntent();
589
                if (Intent.ACTION_VIEW.equals(intent.getAction())) {
590
                    Uri uri = intent.getData();
591
                    startActivityIntent.setAction("31");
592
                    startActivityIntent.setData(Uri.parse(uri.toString()));
593
                }
594
                startActivity(startActivityIntent);
595
                //startActivity(new Intent(SplashScreen.this, MobileNumber.class));
596
            } else*/
597
             if (idCheck != null) {
598
                Intent startActivityIntent=new Intent(SplashScreen.this, MainActivity.class);
599
                Intent intent = getIntent();
600
                if (Intent.ACTION_VIEW.equals(intent.getAction())) {
601
                    Uri uri = intent.getData();
602
                    startActivityIntent.setAction("31");
603
                    startActivityIntent.setData(Uri.parse(uri.toString()));
604
                }
605
                startActivity(startActivityIntent);
606
            }
607
            else {
608
                Intent startActivityIntent=new Intent(SplashScreen.this, LoginActivity.class);
609
                Intent intent = getIntent();
610
                if (Intent.ACTION_VIEW.equals(intent.getAction())) {
611
                    Uri uri = intent.getData();
612
                    startActivityIntent.setAction("31");
613
                    startActivityIntent.setData(Uri.parse(uri.toString()));
614
                }
615
                startActivity(startActivityIntent);
616
 
617
            }
618
        }
619
    }
620
}