-2

Fragments

I had created Tabbed Activity with two tabs.

Fragment 1 Fragment 1 saves data to sqlite database

Fragment 2 Retrieves all data and shows in recycler view

Problem: When the user clicks View User Button the user details should be visible on NewFragment on full screen.But i have no idea about PASSING DATA WITH FRAGMENT TRANSACTION

shyam
  • 1,084
  • 12
  • 20
  • Have you tried using Intent ? You can google your way out of this one I'm sure :) – doom4s Feb 19 '18 at 11:26
  • By intent i can open the new fragment but how to get the particular users data??? – shyam Feb 19 '18 at 11:29
  • [link](https://stackoverflow.com/questions/2091465/how-do-i-pass-data-between-activities-in-android-application) :) – doom4s Feb 19 '18 at 11:37
  • thanks your link is useful i tried with intents it is not working.I want to communicate between 1st Fragment's recycler view adapter and 2nd Fragment.While using interfaces i get this error:Class Cast Exception – shyam Feb 20 '18 at 07:36

1 Answers1

0

To pass data during fragment transaction using Bundle is the good solution.

shyam
  • 1,084
  • 12
  • 20