0

I have a problem when on Fragment transitions.

I want set ActionBar title to "Loading" before switching fragment, code:

getSupportActionBar().setTitle("Loading");
FragmentManager fragmentManager = getSupportFragmentManager();
fragmentManager.popBackStackImmediate();

Title is setted only after the transition, that's the problem.

Update 1: The problem is update the actionbar before UI thread start fragment transition (heavy task).

PS. Sample problem if I want make two fast transitions (like, make a transition to a "loading fragment" then to the main fragment).

AlessioDP
  • 88
  • 9

1 Answers1

0

You can try this: You can use a progress dialog. During the loading of progress dialog set fragment's title to whatever you want.

harshita
  • 457
  • 1
  • 5
  • 19