Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <ol> <li>MainActivity has to extend <code>SherlockFragmentActivity</code> (credits to JosipPranjic!).</li> <li><p>The <em>NullPointerException</em> can be fixed with following code from this SO question: <a href="https://stackoverflow.com/questions/8645549/null-fragmenttransaction-being-passed-to-tablistener-ontabselected">Null FragmentTransaction being passed to TabListener.onTabSelected()</a></p> <pre><code>@Override public void onTabSelected(Tab tab, FragmentTransaction ignoredFt) { FragmentManager fragMgr = ((FragmentActivity) mActivity) .getSupportFragmentManager(); FragmentTransaction ft = fragMgr.beginTransaction(); // Check if the fragment is already initialized if (mFragment == null) { // If not, instantiate and add it to the activity mFragment = Fragment.instantiate(mActivity, mClass.getName()); ft.add(android.R.id.content, mFragment, mTag); } else { // If it exists, simply attach it in order to show it ft.attach(mFragment); } ft.commit(); } @Override public void onTabUnselected(Tab tab, FragmentTransaction ignoredFt) { FragmentManager fragMgr = ((FragmentActivity) mActivity) .getSupportFragmentManager(); FragmentTransaction ft = fragMgr.beginTransaction(); // Check if the fragment is already initialized if (mFragment == null) { // If not, instantiate and add it to the activity mFragment = Fragment.instantiate(mActivity, mClass.getName()); ft.add(android.R.id.content, mFragment, mTag); } else { // If it exists, simply attach it in order to show it ft.detach(mFragment); } ft.commit(); } </code></pre></li> </ol>
    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.
    3. VO
      singulars
      1. This table or related slice is empty.
    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