Java 类com.facebook.react.LifecycleState 实例源码

项目:RNLearn_Project1    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);

    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new MainReactPackage())
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();

    mReactRootView.startReactApplication(mReactInstanceManager, "Basic", null);

    setContentView(mReactRootView);
}
项目:RNLearn_Project1    文件:patchedMainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);

    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new MainReactPackage())
            .addPackage(new VectorIconsPackage())
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();

    mReactRootView.startReactApplication(mReactInstanceManager, "Basic", null);

    setContentView(mReactRootView);
}
项目:RNLearn_Project1    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);

    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new MainReactPackage())
            /* react-native icons */
            .addPackage(new ReactNativeIcons())
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();

    mReactRootView.startReactApplication(mReactInstanceManager, "allyoop", null);

    setContentView(mReactRootView);
}
项目:RNLearn_Project1    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);

    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new MainReactPackage())
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();

    mReactRootView.startReactApplication(mReactInstanceManager, "Basic", null);

    setContentView(mReactRootView);
}
项目:RNLearn_Project1    文件:patchedMainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);

    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new MainReactPackage())
            .addPackage(new VectorIconsPackage())
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();

    mReactRootView.startReactApplication(mReactInstanceManager, "Basic", null);

    setContentView(mReactRootView);
}
项目:RNLearn_Project1    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);

    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new MainReactPackage())
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();

    mReactRootView.startReactApplication(mReactInstanceManager, "nearby", null);

    setContentView(mReactRootView);
}
项目:RNLearn_Project1    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);

    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new MainReactPackage())
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();

    mReactRootView.startReactApplication(mReactInstanceManager, "address_book", null);

    setContentView(mReactRootView);
}
项目:RNNote    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);
    ReactInstanceManager.Builder mB =  ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new MainReactPackage())
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED);


    mReactInstanceManager = mB.build();

    mReactRootView.startReactApplication(mReactInstanceManager, "RNNote", null);

    setContentView(mReactRootView);
}
项目:Ironman    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);

    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new MainReactPackage())
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();

    mReactRootView.startReactApplication(mReactInstanceManager, "Basic", null);

    setContentView(mReactRootView);
}
项目:Ironman    文件:patchedMainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);

    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new MainReactPackage())
            .addPackage(new VectorIconsPackage())
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();

    mReactRootView.startReactApplication(mReactInstanceManager, "Basic", null);

    setContentView(mReactRootView);
}
项目:react-native-android-audio-demo    文件:ReactInstanceSingleton.java   
public static synchronized ReactInstanceManager getReactInstanceManager(
        Application application) {
    if (sSingletonManager == null) {
        ReactInstanceManager.Builder builder = ReactInstanceManager.builder()
                .setApplication(application)
                .setJSMainModuleName("index.android")
                .setUseDeveloperSupport(BuildConfig.DEBUG)
                        // TODO figure out the right thing to put here.
                .setInitialLifecycleState(LifecycleState.BEFORE_RESUME);

        for (ReactPackage reactPackage : getPackages()) {
            builder.addPackage(reactPackage);
        }

        builder.setBundleAssetName("index.android.bundle");
        sSingletonManager = builder.build();
    }
    return sSingletonManager;
}
项目:react-native-extra-dimensions-android    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);

    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new MainReactPackage())
            .addPackage(new ExtraDimensionsPackage(this))
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();

    mReactRootView.startReactApplication(mReactInstanceManager, "Example", null);

    setContentView(mReactRootView);
}
项目:react-native-android-admob    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);

    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new ToastPackage())
            .addPackage(new ReactAdMobPackage())
            .addPackage(new MainReactPackage())                
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();

    mReactRootView.startReactApplication(mReactInstanceManager, "admob", null);

    setContentView(mReactRootView);
}
项目:react-native-android-config    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);

    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new MainReactPackage())
            .addPackage(new ReactConfigPackage())
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();

    mReactRootView.startReactApplication(mReactInstanceManager, "Example", null);

    setContentView(mReactRootView);
}
项目:RNNote    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);
    ReactInstanceManager.Builder mB =  ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new MainReactPackage())
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED);


    mReactInstanceManager = mB.build();

    mReactRootView.startReactApplication(mReactInstanceManager, "RNNote", null);

    setContentView(mReactRootView);
}
项目:react-native-webintent    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);

    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new MainReactPackage())
            .addPackage(new RNWebIntentPackage())
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();

    mReactRootView.startReactApplication(mReactInstanceManager, "WebIntentExample", null);

    setContentView(mReactRootView);
}
项目:Android-Native-Modules    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);

    mActivityResultManager = new ActivityResultManager();

    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new MainReactPackage())
            .addPackage(new YeeuuReactPackage(this))
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();

    mReactRootView.startReactApplication(mReactInstanceManager, "Hello", null);

    setContentView(mReactRootView);
}
项目:react-native-audio-android    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);

    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new MainReactPackage())
            .addPackage(new AudioAndroidPackage())
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();

    mReactRootView.startReactApplication(mReactInstanceManager, "MyFirstReactNative", null);

    setContentView(mReactRootView);
}
项目:rn-geolocation    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);

    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new MainReactPackage())
            .addPackage(new RNGeolocationPackage())
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();

    mReactRootView.startReactApplication(mReactInstanceManager, "testGeolocation", null);

    setContentView(mReactRootView);
}
项目:react-native-image-picker-android    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);

    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new MainReactPackage())
            .addPackage(new ImagePickerPackage(this))
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();

    mReactRootView.startReactApplication(mReactInstanceManager, "ImagePickerAndroid", null);

    setContentView(mReactRootView);
}
项目:react-native-vitamio-demo    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);

    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new MainReactPackage())
            .addPackage(new VitamioViewPackage(this))
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();

    mReactRootView.startReactApplication(mReactInstanceManager, "vitamioDemo", null);

    setContentView(mReactRootView);
}
项目:react-native-android-audio-streaming-aac    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);

    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new MainReactPackage())
            .addPackage(new AACStreamingPackage(MainActivity.class))      // <------- add package
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();

    mReactRootView.startReactApplication(mReactInstanceManager, "example", null);

    setContentView(mReactRootView);
}
项目:rn-camera-roll    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);

    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new MainReactPackage())

            // Add Camera Roll for android
            .addPackage(new CameraRollPackage())
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();

    mReactRootView.startReactApplication(mReactInstanceManager, "example", null);

    setContentView(mReactRootView);
}
项目:binea_project_for_android    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mReactInstanceManager = ReactInstanceManager.builder()
                                                .setApplication(getApplication())
                                                .setBundleAssetName("index.android.bundle")
                                                .setJSMainModuleName("index.android")
                                                .addPackage(new MainReactPackage())
                                                .setUseDeveloperSupport(BuildConfig.DEBUG)
                                                .setInitialLifecycleState(LifecycleState.RESUMED)
                                                .build();
    setContentView(R.layout.activity_main);
    mReactRootView = (ReactRootView) findViewById(R.id.rrv_01);
    mReactRootView.startReactApplication(mReactInstanceManager, "reactwithnative");
}
项目:RxRNBridge    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);

    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new MainReactPackage())
            .addPackage(new RNSamplePackage())
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();

    mReactRootView.startReactApplication(mReactInstanceManager, "RxRNBridgeSample", null);

    setContentView(mReactRootView);
}
项目:react-native-gcm-android    文件:BackgroundService.java   
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
    Log.d(TAG, "onStartCommand");

    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new MainReactPackage())
            .addPackage(new GcmPackage(intent))
            .addPackage(new NotificationPackage(null))
            .setUseDeveloperSupport(getBuildConfigDEBUG())
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();
    mReactInstanceManager.createReactContextInBackground();

    return START_NOT_STICKY;
}
项目:ReactNativeSignatureExample    文件:ReactAppTestActivity.java   
@Override
protected void onPause() {
  super.onPause();

  mLifecycleState = LifecycleState.BEFORE_RESUME;

  overridePendingTransition(0, 0);

  if (mReactInstanceManager != null) {
    mReactInstanceManager.onHostPause();
  }
}
项目:ReactNativeSignatureExample    文件:ReactAppTestActivity.java   
@Override
protected void onResume() {
  super.onResume();

  mLifecycleState = LifecycleState.RESUMED;

  if (mReactInstanceManager != null) {
    mReactInstanceManager.onHostResume(this, this);
  }
}
项目:react-native-ibeacon-android    文件:ReactAppTestActivity.java   
@Override
protected void onPause() {
  super.onPause();

  mLifecycleState = LifecycleState.BEFORE_RESUME;

  overridePendingTransition(0, 0);

  if (mReactInstanceManager != null) {
    mReactInstanceManager.onHostPause();
  }
}
项目:react-native-ibeacon-android    文件:ReactAppTestActivity.java   
@Override
protected void onResume() {
  super.onResume();

  mLifecycleState = LifecycleState.RESUMED;

  if (mReactInstanceManager != null) {
    mReactInstanceManager.onHostResume(this, this);
  }
}
项目:RNNote    文件:RNCore.java   
private ReactInstanceManager.Builder fetchBuilder(String bundlePath, String moduleName) {
        if(mBuilder == null){
            mBuilder =  ReactInstanceManager.builder()
//                    .setApplication(mApplication)
//                    .addPackage(PackageHolder.holdAliRnPackage())
                    .setJSMainModuleName(moduleName)
                    .setJSBundleFile(bundlePath)
                    .setUseDeveloperSupport(false)
                    .setInitialLifecycleState(LifecycleState.RESUMED);
        }
        return mBuilder;
    }
项目:react-native-box-loaders    文件:ReactAppTestActivity.java   
@Override
protected void onPause() {
  super.onPause();

  mLifecycleState = LifecycleState.BEFORE_RESUME;

  overridePendingTransition(0, 0);

  if (mReactInstanceManager != null) {
    mReactInstanceManager.onHostPause();
  }
}
项目:react-native-box-loaders    文件:ReactAppTestActivity.java   
@Override
protected void onResume() {
  super.onResume();

  mLifecycleState = LifecycleState.RESUMED;

  if (mReactInstanceManager != null) {
    mReactInstanceManager.onHostResume(this, this);
  }
}
项目:mia-tracking    文件:TrackingLayer.java   
/**
 * Initializes the tracking layer.
 * @param activity the activity that instantiates the layer.
 */
public TrackingLayer(final Activity activity, final TrackingLayerConfiguration config) {
    nativeModuleReactPackage = new NativeModuleReactPackage(activity, config);
    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(activity.getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index")
            .addPackage(nativeModuleReactPackage)
            .setUseDeveloperSupport(config.getDeveloperSupport())
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();

    mReactInstanceManager.createReactContextInBackground();
    mReactInstanceManager.onResume(activity, null);
}
项目:RNNote    文件:RNCore.java   
private ReactInstanceManager.Builder fetchBuilder(String bundlePath, String moduleName) {
        if(mBuilder == null){
            mBuilder =  ReactInstanceManager.builder()
//                    .setApplication(mApplication)
//                    .addPackage(PackageHolder.holdAliRnPackage())
                    .setJSMainModuleName(moduleName)
                    .setJSBundleFile(bundlePath)
                    .setUseDeveloperSupport(false)
                    .setInitialLifecycleState(LifecycleState.RESUMED);
        }
        return mBuilder;
    }
项目:LetsDoThis-Android    文件:NewsFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    mReactRootView = new ReactRootView(getActivity());
    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(getActivity().getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new LDTReactPackage())
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();
    mReactRootView.startReactApplication(mReactInstanceManager, "NewsFeedView", null);

    return mReactRootView;
}
项目:houndify-smart-mirror    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    //Remove title bar
    this.requestWindowFeature(Window.FEATURE_NO_TITLE);
    View decorView = getWindow().getDecorView();
    int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_FULLSCREEN;
    decorView.setSystemUiVisibility(uiOptions);

    mReactRootView = new ReactRootView(this);
    mReactInstanceManager = ReactInstanceManager.builder()
            .setApplication(getApplication())
            .setBundleAssetName("index.android.bundle")
            .setJSMainModuleName("index.android")
            .addPackage(new MainReactPackage())
            .addPackage(new HoundifyReactPackage(this))
            .addPackage(new VectorIconsPackage())
            .setUseDeveloperSupport(BuildConfig.DEBUG)
            .setInitialLifecycleState(LifecycleState.RESUMED)
            .build();
    mReactRootView.startReactApplication(mReactInstanceManager, "MirrorApp", null);
    setContentView(mReactRootView);

    am = (AudioManager)getSystemService(Context.AUDIO_SERVICE);

    AudioAttributes attr = new AudioAttributes.Builder()
        .setUsage(AudioAttributes.USAGE_MEDIA)
        .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
        .build();

    soundPool = new SoundPool.Builder()
        .setMaxStreams(2)
        .setAudioAttributes(attr)
        .build();

    soundOnRecordStart = soundPool.load(this, com.hound.android.voicesdk.R.raw.houndify_start, 1);
    soundOnRecordStop = soundPool.load(this, com.hound.android.voicesdk.R.raw.houndify_stop, 1);

    textToSpeechMgr = new TextToSpeechMgr( this );

    startPhraseSpotting();
}