Rohit Singh

If you want something like this.

Then you are at the right place. It’s really simple. Just Create these 4 anim XML files, and replace the current fragment with your new fragment.

2 Fragments - 4 Anims

  • DogsListFragment + DogDetailFragment
  • slide_in_bottom + slide_out_top + slide_in_top + slide_out_bottom.

But let’s visualize it first.

Fragment API unlike Activity API does not come with Back Button navigation by default. So if you have added or replaced many Fragments on a Fragment container. There is no way to go back to the previous Fragment on a Back Button Pressed.

Let's see the difference between the behaviors

Advantages of using LocalBroadcast Receiver over Broadcast Reciever?

  1. Secure Out: Your broadcasted data remains inside the App. So other apps can not receive your data
  2. Secure In: Your app will not receive Data from other apps Broadcast.
  3. Drains less battery: It is a more efficient way to send/receive data locally.

How to change your global Broadcast to LocalBroadcast?