What is the difference between a Fragment and an Activity in Android?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our W3Make Forum to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
An Activity represents a single screen with a user interface, while a Fragment represents a portion of a user interface or an operation that runs within an Activity. A Fragment can be used to split a user interface into multiple reusable pieces, or to perform a background operation that doesn’t require a user interface. Fragments can be added or removed from an Activity dynamically, which makes them a powerful tool for creating flexible and responsive user interfaces.