I am using wix react-native-navigation library for navigation at app level. Also, I have library node module, in that module I am having an Activity which extends ReactActivity. When I try to open that ReactActivity from my app's MainActivity which extends NavigationActivity, I am getting below error.
java.lang.RuntimeException: Unable to resume activity {SomeActivityWhichExtendsReactActivity}: java.lang.ClassCastException: SomeActivityWhichExtendsReactActivity cannot be cast to com.reactnativenavigation.NavigationActivity.
Here is code to open ReactActivity(in library module)
@ReactMethod public void openActivity(){ Intent intent = new Intent(reactContext, SomeActivityWhichExtendsReactActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); reactContext.startActivity(intent)` }
In the app level, from a component on click of button when i am calling openActivity() method, getting below
java.lang.RuntimeException: Unable to resume activity {SomeActivityWhichExtendsReactActivity}: java.lang.ClassCastException: SomeActivityWhichExtendsReactActivity cannot be cast to com.reactnativenavigation.NavigationActivity.
My ReactActivity should open.