Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For the first screen, i would use a seperate activity. CaseyB's answer is really good, and it is actually how I hand it as well (now, when you have alot of orientation changes, and a few things on the backstack, you'll get forcecloses, but its inevitable). What I would do is the first screen, make it its own activity, then call a second FragmentActivity and make the fragment on the Left side static (meaning define it in XML). That way you dont have to worry about it. Then, you can focus on the right fragment. If you set the setRetainInstance, then you dont need to worry about recreating the views. But, if it goes to the backstack, then you lose everything. It never calls onDestroy, only onDetach. And onCreate is only called the first time the fragment is created. So, I would avoid using onCreate at all, and focus on using onActivityCreated() and onAttach() to instantiate values and whatnot</p> <p>Update - Use the onCreate() method to set setRetainInstance(true) and call your JSON and network code to create the views. Its important to do it here, so that it only gets called once. This should work entirely for orientation changes and going back and forth between fragments (the backstack will work, just you cant set it to retainInstance while in the backstack. That was a typo on my part). </p> <p>Then, any other code you want called when the fragment is brought back up, use onAttach() since onCreate() wont be called since it was never destoryed</p> <p>Then, in order to get control of your items again, you cant use getActivity().findViewById(), you have to use this.getView().findViewById(). I dont know why that is the case (since you would think that it would be attached to the activity viewgroup, but it isnt). That should be the only hiccup you should hit. Outside of that, it should work perfectly fine. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload