Showing the changes to android/apps/interface/src/main/java/io/highfidelity/hifiinterface/InterfaceActivity.java (1 of 4 files). Show all
Unified · Split
| @@ -24,6 +24,7 @@ import android.net.Uri; · 23 unmodified lines | ||
| 24 | 24 | import android.os.Build; |
| 25 | 25 | import android.os.Bundle; |
| 26 | 26 | import android.os.Vibrator; |
| 27 | +import android.text.TextUtils; | |
| 27 | 28 | import android.util.Log; |
| 28 | 29 | import android.view.LayoutInflater; |
| 29 | 30 | import android.view.View; |
| @@ -53,6 +54,7 @@ public class InterfaceActivity extends QtActivity implements WebViewFragment.OnW · 23 unmodified lines | ||
| 53 | 54 | public static final String DOMAIN_URL = "url"; |
| 54 | 55 | public static final String EXTRA_GOTO_USERNAME = "gotousername"; |
| 55 | 56 | private static final String TAG = "Interface"; |
| 57 | + public static final String EXTRA_ARGS = "args"; | |
| 56 | 58 | private static final int WEB_DRAWER_RIGHT_MARGIN = 262; |
| 57 | 59 | private static final int WEB_DRAWER_BOTTOM_MARGIN = 150; |
| 58 | 60 | private static final int NORMAL_DPI = 160; |
| @@ -77,6 +79,7 @@ public class InterfaceActivity extends QtActivity implements WebViewFragment.OnW · 18 unmodified lines | ||
| 77 | 79 | |
| 78 | 80 | private boolean nativeEnterBackgroundCallEnqueued = false; |
| 79 | 81 | private SlidingDrawer mWebSlidingDrawer; |
| 82 | + private boolean mStartInDomain; | |
| 80 | 83 | // private GvrApi gvrApi; |
| 81 | 84 | // Opaque native pointer to the Application C++ object. |
| 82 | 85 | // This object is owned by the InterfaceActivity instance and passed to the native methods. |
| @@ -92,8 +95,14 @@ public class InterfaceActivity extends QtActivity implements WebViewFragment.OnW · 9 unmodified lines | ||
| 92 | 95 | public void onCreate(Bundle savedInstanceState) { |
| 93 | 96 | super.isLoading = true; |
| 94 | 97 | Intent intent = getIntent(); |
| 95 | − if (intent.hasExtra(DOMAIN_URL) && !intent.getStringExtra(DOMAIN_URL).isEmpty()) { | |
| 98 | + if (intent.hasExtra(DOMAIN_URL) && !TextUtils.isEmpty(intent.getStringExtra(DOMAIN_URL))) { | |
| 96 | 99 | intent.putExtra("applicationArguments", "--url " + intent.getStringExtra(DOMAIN_URL)); |
| 100 | + } else if (intent.hasExtra(EXTRA_ARGS)) { | |
| 101 | + String args = intent.getStringExtra(EXTRA_ARGS); | |
| 102 | + if (!TextUtils.isEmpty(args)) { | |
| 103 | + mStartInDomain = true; | |
| 104 | + intent.putExtra("applicationArguments", args); | |
| 105 | + } | |
| 97 | 106 | } |
| 98 | 107 | super.onCreate(savedInstanceState); |
| 99 | 108 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); |
| @@ -124,7 +133,10 @@ public class InterfaceActivity extends QtActivity implements WebViewFragment.OnW · 24 unmodified lines | ||
| 124 | 133 | getActionBar().hide(); |
| 125 | 134 | } |
| 126 | 135 | }); |
| 127 | − startActivity(new Intent(this, SplashActivity.class)); | |
| 136 | + Intent splashIntent = new Intent(this, SplashActivity.class); | |
| 137 | + splashIntent.putExtra(SplashActivity.EXTRA_START_IN_DOMAIN, mStartInDomain); | |
| 138 | + startActivity(splashIntent); | |
| 139 | + | |
| 128 | 140 | mVibrator = (Vibrator) this.getSystemService(VIBRATOR_SERVICE); |
| 129 | 141 | headsetStateReceiver = new HeadsetStateReceiver(); |
| 130 | 142 | } |