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 7944581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:35:40+00:00 2026-06-04T00:35:40+00:00

My question is apart from the obvious inheritance differences, what are the main differences

  • 0

My question is apart from the obvious inheritance differences, what are the main differences between Fragment and FragmentActivity? To what scenarios are each class best suited? I’m trying to get an understanding of why both of these classes exist…

  • 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-06-04T00:35:41+00:00Added an answer on June 4, 2026 at 12:35 am

    A Fragment is a section of an Activity, which has:

    • its own lifecycle
    • receives its own input events
    • can be added or removed while the Activity is running.

    A Fragment must always be embedded in an Activity.

    Fragments are not part of the API prior to HoneyComb (3.0). If you want to use Fragments in an app targeting a platform version prior to HoneyComb, you need to add the Support Package to your project and use the FragmentActivity to hold your Fragments. The FragmentActivity class has an API for dealing with Fragments, whereas the Activity class, prior to HoneyComb, doesn’t.

    If your project is targeting HoneyComb or newer only, you should use Activity and not FragmentActivity to hold your Fragments.

    Some details:

    Use android.app.Fragment with Activity. Use android.support.v4.app.Fragment with FragmentActivity. Don’t add the support package Fragment to an Activity as it will cause an Exception to be thrown.

    A thing to be careful with: FragmentManager and LoaderManager have separate support versions for FragmentActivity:

    If you are using a Fragment in an Activity (HoneyComb and up), call

    • getFragmentManager() to get android.app.FragmentManager
    • getLoaderManager() to get android.app.LoaderManager

    if you are using a Fragment in a FragmentActivity (pre-HoneyComb), call:

    • getSupportFragmentManager() to get android.support.v4.app.FragmentManager.
    • getSupportLoaderManager() to get android.support.v4.app.LoaderManager

    so, don’t do

    //don't do this
    myFragmentActivity.getLoaderManager(); 
    //instead do this:
    myFragmentActivity.getSupportLoaderManager();
    

    or

    //don't do this:
    android.app.FragmentManager fm = myFragmentActivity.getSupportFragmentManager();
    //instead do this:
    android.support.v4.app.FragmentManager fm = myFragmentActivity.getSupportFragmentManager()
    

    Also useful to know is that while a fragment has to be embedded in an Activity it doesn’t have to be part of the Activity layout. It can be used as an invisible worker for the activity, with no UI of its own.

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

Sidebar

Related Questions

this is probably a n00b question, but even so... Apart from MS Office, I
Well, not much to ask apart from the question. What do you mean when
Quick question I have a fully functional database website apart from the filter aspect.
Question 1) I have a control to which I add an attribute from the
Question about subclassing in matlab, under the new class system. I've got class A
Question: I'm interested to know the best practice for killing a long standing operation
I’m new to WPF, so I apologise if this is an obvious question. I’m
Here's the question first: Is this possible? I'm taking my inspiration from Joe Wrobel's
I have a program that I am writing, not too big. Apart from the
Put simply, I have a WCF service that manages apples. Apart from other functionality,

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.