Please tell me 🙏 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Please tell me 🙏

How to open a new fragment from an activity by clicking on a button?

31st Dec 2020, 6:32 AM
Manash Saikia [ 45% Active ]
Manash Saikia [ 45% Active ] - avatar
1 Answer
+ 4
I think your problem is basic, there‌ are already several lessons and topic out there to explain all this in detail, You need more information and do study about fragments. First you need to create a fragment placeholder(<Frame layout>). //Inside click listener FragmentManager manager = getSupportFragmentManager(); FragmentTransaction transaction = manager.beginTransaction(); transaction.add(ID_OF_YOUR_FRAMELAYOUT,YOUR_FRAGMENT_NAME,YOUR_FRAGMENT_STRING_TA); transaction.addToBackStack(null); transaction.commit(); );
31st Dec 2020, 6:47 AM
0_O-[Mägár_Sám_Äkà_Nüllpøïntêr_Èxëcéptïön]~~
0_O-[Mägár_Sám_Äkà_Nüllpøïntêr_Èxëcéptïön]~~ - avatar