Home:ALL Converter>Most efficient way for passing data between two fragments

Most efficient way for passing data between two fragments

Ask Time:2015-07-15T04:10:19         Author:BVtp

Json Formatter

If I have a hosting activity of two fragments, and I want to send data from one fragment to the other (and vice versa) what would be the most efficient way to do so?

  1. Implementing an interface, declaring the fragments in layout....
  2. Creating a Singleton class that both fragments can use to set/get the private static variable inside the class.
  3. ?

Author:BVtp,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/31416344/most-efficient-way-for-passing-data-between-two-fragments
yy