Skip to content

YudizAndroidVarshil/FragmentDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FragmentDemo

📚 Official Documentation Links

📖 Android Fragments - Official Docs

🔹 Fragments

📖 ViewPager2 - Official Docs

🔹 ViewPager2

📖 FragmentStateAdapter - Official Docs

🔹 FragmentStateAdapter

📖 TabLayoutMediator - Official Docs

🔹 TabLayoutMediator


📌 Task Definition: Multi-Screen Data Sharing with ViewPager2 & TabLayout

📌 Task Requirements:

1️⃣ Implement ViewPager2 & TabLayout with three fragments.

2️⃣ Pass data from Fragment A → Fragment B & Fragment C using Bundle.

3️⃣ Fragment B should modify the received data and send it back to Fragment A.

4️⃣ Fragment C should display text in uppercase and also allow resetting the data.


📌 Expected Flow:

1️⃣ User enters text in Fragment A and clicks “Send”.

2️⃣ Fragment B displays the received text but also has a “Modify & Send Back” button that modifies the text and updates Fragment A.

3️⃣ Fragment C displays the received text in uppercase and has a “Reset” button that clears the text in all fragments.


💡 Hints:

  • Use setArguments() and getArguments() to pass data initially.

  • Use setFragmentResult() and setFragmentResultListener() to send modified data back.

  • Handle the “Reset” action properly, ensuring all fragments clear their text when clicked.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages