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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:36:04+00:00 2026-05-28T07:36:04+00:00

I am trying to implement fragments into an old app so I can support

  • 0

I am trying to implement fragments into an old app so I can support tablets. As I want to support pre 3.0 phones as well so I am using FragmentActivity from the v4 support package.

I have a main fragmentActivity which opens a second fragment activity if the app is not running on a tablet.

public class MainActivity extends FragmentActivity implements POIListFragment.ListItemSelectedListener{

    private POIDetailFragment detailFrag;
    private boolean isFirst = true;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.list_layout);

    }

    @Override
    public void onListItemSelected(String id, boolean isRest) {
        detailFrag = (POIDetailFragment) getSupportFragmentManager().findFragmentById(R.id.poiDetailFragment);

        if (detailFrag == null) {
            if(isFirst){
                isFirst = false;
            } else {
                Intent intent = new Intent(this, DetailFragmentActivity.class);
                Bundle data = new Bundle();
                data.putString("id", id);
                data.putBoolean("isRest", isRest);
                intent.putExtras(data);

                startActivity(intent);  
            }
        } else {
            detailFrag.update(id, isRest);
        }

}

This part of the code works fine. The statActivity(intent); opens the new fragmentactivity. However when the back button is pressed on that fragmentactivity the whole application closes.

How can I make the current fragmentactivity close revealing the previous one?

  • 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-28T07:36:05+00:00Added an answer on May 28, 2026 at 7:36 am

    Rookie error unfortunately. I had been previously using the activity as a splash screen and so had the android:noHistory=”true” marks in the manifest. Its working fine after I changed that.

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

Sidebar

Related Questions

My app is currently using the Fragments/v4 compatibility package to support Android versions all
I am trying to implement Fragments in my Project using the https://github.com/JakeWharton/Android-ViewPagerIndicator plugin. My
While trying to implement some jQuery UI Tabs using AJAX I keep running into
trying to implement a dialog-box style behaviour using a separate div section with all
Trying to implement a UITableView of names similar to the built-in Contacts iPhone app
im trying to implement a custom error page, what i want to be able
I've been trying to implement the Facebook SDK into my application in order to
Ok well I'm trying implement something similar to the 'undo' function in many image
Trying to implement some nested loops that are spitting out good old nested html
What am I trying to implement? A gallery of images using ViewPager. I choose

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.