You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that
When I try to link react-native-threads package upon this basis, I don't have a certain argument to feed.
The bridging activity starts like this.
public class MyReactActivity extends Activity implements DefaultHardwareBackBtnHandler {
private ReactRootView mReactRootView;
private ReactInstanceManager mReactInstanceManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mReactRootView = new ReactRootView(this);
mReactInstanceManager = ReactInstanceManager.builder()
.setApplication(getApplication())
.setBundleAssetName("index.android.bundle")
.setJSMainModulePath("index")
.addPackage(new MainReactPackage())
.setUseDeveloperSupport(BuildConfig.DEBUG)
.setInitialLifecycleState(LifecycleState.RESUMED)
.build();
// The string here (e.g. "MyReactNativeApp") has to match
// the string in AppRegistry.registerComponent() in index.js
mReactRootView.startReactApplication(mReactInstanceManager, "MyReactNativeApp", null);
setContentView(mReactRootView);
}
@Override
public void invokeDefaultOnBackPressed() {
super.onBackPressed();
}
}
As explained in the Readme file of this package,
Also note that only the official react native modules are available from your threads (vibration, fetch, etc...). To include additional native modules in your threads, pass them into the RNThreadPackage constructor after the mReactNativeHost like this: new RNThreadPackage(mReactNativeHost, new ExampleNativePackage(), new SQLitePackage())
I tried to feed "mReactNativeHost".
At first, I tried this code
private ReactRootView mReactRootView;
...
mReactNativeHost = ((ReactApplication) getApplication()).getReactNativeHost();
...
new RNThreadPackage(mReactNativeHost, new BlePackage())
However, this gives me the log like this:
android.app.Application cannot be cast to com.facebook.react.ReactApplication
I know this is more about the general knowledge on android.
But I'm trying to run bluetooth communication on another process using this package.
So, please help me if any of you guys had an experience like this.
Thank you.
The text was updated successfully, but these errors were encountered:
SokWonJeremyKim
changed the title
[Question}
[Question] editing android native code for linking the package
Sep 19, 2018
Hello.
My react native app is integrated with a pre-existing android native application.
So, I've followed the steps explained in this link.
http://facebook.github.io/react-native/docs/integration-with-existing-apps
The problem is that
When I try to link react-native-threads package upon this basis, I don't have a certain argument to feed.
The bridging activity starts like this.
As explained in the Readme file of this package,
I tried to feed "mReactNativeHost".
At first, I tried this code
However, this gives me the log like this:
I know this is more about the general knowledge on android.
But I'm trying to run bluetooth communication on another process using this package.
So, please help me if any of you guys had an experience like this.
Thank you.
The text was updated successfully, but these errors were encountered: