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
If you already extend other class than ReactActivity (e.g. if you use react-native-navigation) or integrate React Native in native app, make sure that the Activity is a descendant of android.support.v7.app.AppCompatActivity. Then add CastContext.getSharedInstance(this); to your Activity's onCreate method (this lazy loads the Google Cast context).
If MainActivity extends NavigationActivity and I add CastContext.getSharedInstance(this); to the onCreate method, then I get build errors. Am I missing something else?
build errors (I assume this is due to not extending GoogleCastActivity. Does that mean I must extend GoogleCastActivity?):
@Override
^
1 error
:app:compileDebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.```
The text was updated successfully, but these errors were encountered:
jedashford
changed the title
How to we use react-native-navigation with react-native-google-cast?
How to use react-native-navigation with react-native-google-cast?
Jun 28, 2018
Hmm also initializing the cast context in MainApplication instead of MainActivity as suggested by #25 might help. That throws java.lang.IllegalStateException: The activity must be a subclass of FragmentActivity.
It looks like you specific mention this here:
If MainActivity extends NavigationActivity and I add
CastContext.getSharedInstance(this);
to theonCreate
method, then I get build errors. Am I missing something else?build errors (I assume this is due to not extending GoogleCastActivity. Does that mean I must extend GoogleCastActivity?):
The text was updated successfully, but these errors were encountered: