/**
 * The examples provided by Facebook are for non-commercial testing and
 * evaluation purposes only.
 *
 * Facebook reserves all rights not expressly granted.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
 * FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package com.facebook.react.uiapp;

import android.os.Bundle;

import com.facebook.react.ReactActivity;

public class UIExplorerActivity extends ReactActivity {
  private final String PARAM_ROUTE = "route";
  private Bundle mInitialProps = null;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // Get remote param before calling super which uses it
    Bundle bundle = getIntent().getExtras();
    if (bundle != null && bundle.containsKey(PARAM_ROUTE)) {
      String routeUri = new StringBuilder("rnuiexplorer://example/")
        .append(bundle.getString(PARAM_ROUTE))
        .append("Example")
        .toString();
      mInitialProps = new Bundle();
      mInitialProps.putString("exampleFromAppetizeParams", routeUri);
    }
    super.onCreate(savedInstanceState);
  }

  @Override
  protected Bundle getLaunchOptions() {
    return mInitialProps;
  }

  @Override
  protected String getMainComponentName() {
    return "UIExplorerApp";
  }
}

@@ -655,16 +655,45 @@
 uiapp;%0A%0A
+import android.app.Activity;%0A
 import a
@@ -756,74 +756,248 @@
 ty;%0A
-%0Apublic class UIExplorerActivity extends ReactActivity %7B%0A  private
+import com.facebook.react.ReactActivityDelegate;%0A%0Aimport javax.annotation.Nullable;%0A%0Apublic class UIExplorerActivity extends ReactActivity %7B%0A  public static class UIExplorerActivityDelegate extends ReactActivityDelegate %7B%0A    private static
  fin
@@ -1029,16 +1029,18 @@
 route%22;%0A
+  
   privat
@@ -1070,17 +1070,234 @@
 = null;%0A
-%0A
+    private final @Nullable Activity mActivity;%0A%0A    public UIExplorerActivityDelegate(Activity activity, String mainComponentName) %7B%0A      super(activity, mainComponentName);%0A      this.mActivity = activity;%0A    %7D%0A%0A  
   @Overr
@@ -1292,32 +1292,34 @@
 %0A%0A    @Override%0A
+  
   protected void
@@ -1353,24 +1353,26 @@
 nceState) %7B%0A
+  
     // Get r
@@ -1422,16 +1422,18 @@
  it%0A    
+ 
+ 
 Bundle b
@@ -1440,16 +1440,26 @@
 undle = 
+mActivity.
 getInten
@@ -1471,24 +1471,26 @@
 etExtras();%0A
+  
     if (bund
@@ -1544,16 +1544,18 @@
 %7B%0A      
+  
 String r
@@ -1609,32 +1609,34 @@
 mple/%22)%0A        
+  
 .append(bundle.g
@@ -1658,32 +1658,34 @@
 ROUTE))%0A        
+ 
+ 
 .append(%22Example
@@ -1695,16 +1695,18 @@
         
+  
 .toStrin
@@ -1706,24 +1706,26 @@
 toString();%0A
+  
       mIniti
@@ -1750,24 +1750,26 @@
 le();%0A      
+  
 mInitialProp
@@ -1824,18 +1824,22 @@
 i);%0A    
-%7D%0A
+  %7D%0A  
     supe
@@ -1870,23 +1870,27 @@
 State);%0A
+  
   %7D%0A%0A  
+ 
+ 
 @Overrid
@@ -1883,32 +1883,34 @@
 %0A%0A    @Override%0A
+  
   protected Bund
@@ -1933,24 +1933,26 @@
 ons() %7B%0A    
+  
 return mInit
@@ -1961,16 +1961,178 @@
 lProps;%0A
+    %7D%0A  %7D%0A%0A  @Override%0A  protected ReactActivityDelegate createReactActivityDelegate() %7B%0A    return new UIExplorerActivityDelegate(this, getMainComponentName());%0A
   %7D%0A%0A  @

Move `getLaunchOptions` from ReactActivity to ReactActivityDelegate