Fragment vs Activity | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Fragment vs Activity

In Android when to use Fragment and when to use Activity?

25th Mar 2017, 8:22 AM
Bhabesh Gogoi
Bhabesh Gogoi - avatar
1 Answer
+ 7
Activity is the screen itself But the Fragment is a part of the screen and you can make 2 or more fragments in the same screen but you can make only one activity on the can connect the fragments using the main activity file
25th Mar 2017, 12:13 PM
Michael Ehab Mikhail
Michael Ehab Mikhail - avatar