Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does FragmentTransaction work sporadically?
    text
    copied!<p>I have several fragments in my xml (4 of them). The first time I run the activity with this code:</p> <pre><code>private void loadSenderFragment(int sender_fragment) { FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); // TODO: Animation for later if (loadRunOnce) { //ft.setCustomAnimations(R.anim.fade_in, R.anim.fade_out, R.anim.fade_in, R.anim.fade_out); } switch (sender_fragment) { case FILES_TO_SEND_FRAGMENT: Log.i(StaticValues.TAG, "files to send fragment visisble"); ft.hide(fragmentSendDev); ft.show(fragmentFilesSend); break; case SEND_TO_FRAGMENT: Log.i(StaticValues.TAG, "hiding filesSend, loading senddev"); ft.hide(fragmentFilesSend); ft.show(fragmentSendDev); break; } if (loadRunOnce) ft.addToBackStack(null); else { ft.hide(fragmentReceiveWait); ft.hide(fragmentReceiving); loadRunOnce = true; } ft.commit(); } </code></pre> <p>It shows the proper view (Files_to_send_fragment), then from that fragment via a callback I call loadSenderFragment again except this time with the case of SEND_TO_FRAGMENT. I know that this gets called because my log : hiding fileSend, loading senddev shows up on my logcat and the ft.addToBackStack works as well because pressing theback button does not cancel the activity this is in . But the layout from fragmentFilesSend keeps showing while the other does not not(a page with a white background currently). From what I understand from my code and my intention is, hide filessend and show senddev. Does anyone know why that hide/show might not be working.</p> <p>BTW I am using the compatibility library. (also tried the regular api Honeycomb+ library and still nothing).</p>
 

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