0

Im transitioning between 2 activities using

overridePendingTransition(R.anim.enter_from_right, R.anim.exit_to_left)

My second activity has a frame layout which it then adds a fragment to using

supportFragmentManager.beginTransaction().replace(R.id.fragment_container, fragment, tag).commit()

The problem is that the second Activity with the fragments view isn't rendered until about halfway / end of the transition meaning it appears that I am transitioning to a blank screen.

Is there away to not start the transition until the second activity has finished rendering?

Also I need this to work on API levels < 21

Ian Ellis
  • 650
  • 5
  • 10

1 Answers1

0

Ok I managed to get this working. I was starting the new activity with the following flags:

intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)

to stop the user going back to them. Instead I removed the flag and called

finish()

After

overridePendingTransition(R.anim.enter_from_right, R.anim.exit_to_left);

I guess it is because I was starting a whole new task, meaning the startup takes a little longer

Ian Ellis
  • 650
  • 5
  • 10