title: Control focus order between ViewGroups with uncertain items
body: <p>I have an Android TV layout likes the image below.</p>
  
  <ol>
  <li>A PagerSlidingTabStrip on the top, and the data are pulled from the server;</li>
  <li>A ViewPager with Fragments on the bottom, and each fragment has a horizontal RecyclerView.</li>
  </ol>
  
  <p><strong>Scenario:</strong></p>
  
  <p>When the first tab(<strong>tab0</strong>) gets focus, then press the D-pad in <strong>down->right</strong> direction, the <strong>item2</strong> in the RecyclerView get focus which works as expected;</p>
  
  <p>Then press the D-pad in <strong>up</strong> direction, the <strong>tab4</strong> get focus, which follows the default focus search order.</p>
  
  <p><strong>Question:</strong></p>
  
  <p>My question is how to keep the <strong>tab0</strong> (last focused tab) get focus instead of tab4.</p>
  
  <p>I know we can define the behavior by specifying, for each View, which control should gain focus next with <em>nextFocusUp, nextFocusUp, nextFocusLeft, nextFocusRight</em> attributes. But how to control focus order between ViewGroup with uncertain items for my part.</p>
  
  <p><a href="https://i.stack.imgur.com/Gt2ZT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Gt2ZT.jpg" alt="enter image description here"></a></p>