Posts

Showing posts with the label android-fragments

React native inside Fragment Android

I am trying to open react native pages inside a fragment in android. I followed the following link React-native inside a Fragment I am able to open the react native page but the touchlisteners inside react pages are not working. Can somebody can suggest some method how to do it as the react native loses its focus when added to a fragment.

React-native inside a Fragment

How to Start react-native inside of a fragment? While putting react-native inside Fragment, onCreateView function is unable to return View from mReactRootView. View view = inflater.inflate(mReactRootView. , container, false); I've managed to figure this out with much trial and error. I've seen this question asked around the internet and thought that this was the best place to post the answer. Here is how to do with the latest version of React (0.29 as of this writing): The first thing we'll do is create an abstract ReactFragment class that we will use throughout our app: public abstract class ReactFragment extends Fragment { private ReactRootView mReactRootView; private ReactInstanceManager mReactInstanceManager; // This method returns the name of our top-level component to show public abstract String getMainComponentName(); @Override public void onAttach(Context context) { super.onAttach(context); mReactRootVie...