Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4327110
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:29:31+00:00 2026-05-21T09:29:31+00:00

Could somebody please explain the exact advantages of using Fragments? In what cases should

  • 0

Could somebody please explain the exact advantages of using Fragments? In what cases should we use Fragments?

For what I understand, this framework:

  • Helps reuse existing code – if I implement functionality in a Fragment, then it’s relatively easy to display this fragment in multiple parts of my app, when the functionality is needed.

  • Helps dealing with multiple screen sizes – a device with a huge screen may be able to display multiple fragments at once, and for smaller devices I can display the fragments in separate Activities.

Is there more to this framework?

Edit:

I’ve been using Fragments quite extensively in a larger project for 3.0 tablets. To me the greatest advantage was that using fragments I could break up the logic that would go in a single, monolithic Activity into multiple, smaller Fragments. Big screens mean huge Activities, difficult to read, understand (especially to new team members), develop and maintain. Fragments certainly helped in this matter.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T09:29:32+00:00Added an answer on May 21, 2026 at 9:29 am

    Is there more to this framework?

    • Animated effects available when dynamically adding and removing fragments from the screen

    • Automatic BACK stack management, so the BACK button can remove dynamically-added fragments before eventually exiting the activity

    • Integration with the action bar for tabs, as a replacement for TabHost

    • Integration with the action bar for “list”-based navigation (really a Spinner in the action bar, toggling between different fragments)

    • Somewhat easier handling of configuration changes courtesy of setRetainInstance(true)

    Also, responding to @Jim Blackler:

    I share your confusion, since it’s always been easy to customize Views which seems (to me) to solve all the same problems.

    Everything offered by fragments can, by definition, be done using Views, simply because fragments are built on top of the view framework. However, fragments make more complicated scenarios involving dynamic fragments a bit easier IMHO.

    Moreover, fragments in conjunction with the action bar seem quite likely to be a long-term area of attention for Google, meaning I expect a fair amount of additional work in this area over the next 2-3 releases.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could somebody please explain what this notation is in javascript? What is function(d) doing?
Could somebody please explain to me why does this code only print 42 instead
Could somebody please explain this to me. It seems to me that the number
I do not understand how this code is compiling. Can somebody please explain what
Could somebody please explain what GCC is doing for this piece of code? What
could somebody please explain why this happens? I have written the following: 1) a
Could somebody please explain how to make a countdown timer using clock_gettime, under Linux.
Could somebody please explain this piece of Ruby code: def add_spec_path_to(args) # :nodoc: args
Could somebody please explain the meaning of this error? INFO: Scanning for root resource
Could somebody please explain or link to a resource that will tell me why

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.