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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:40:27+00:00 2026-06-03T13:40:27+00:00

Java answers fine, I tend to use C# for Android. In my ActivityGroup I

  • 0

Java answers fine, I tend to use C# for Android.

In my ActivityGroup I have this method which starts and shows a child activity:

    public void StartChildActivity (string Id, Intent intent)
    {
        intent.AddFlags (ActivityFlags.ClearTop);
        Window window = LocalActivityManager.StartActivity (Id, intent);
        if (window != null)
        {
            mIdList.Add (Id);
            SetContentView (window.DecorView);
        }
    }

However, when I handle the back button to “pop” off a view and return it to the previous one, the app closes when finish is called:

    public override void OnBackPressed ()
    {
        int length = mIdList.Count;
        if (length > 1)
        {

            Activity current = LocalActivityManager.GetActivity (mIdList [length - 1]);
            current.Finish();
        }           
    }

How do I get the view to “pop” instead of shut down the app?

  • 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-03T13:40:27+00:00Added an answer on June 3, 2026 at 1:40 pm

    This sounds very familiar trying to make an iOS port?

    This is how I start my activities

     String id = "SOME_UNIQUE_ID";
     Intent intent = new Intent(context,SomeClass.class);
     intent.putExtra("UniqueID", id);
     LocalActivityManager m = getLocalActivityManager();
     Window w = m.startActivity(id, intent);
     setContentView(w.getDecorView());
     intentStack.push(intent);
    

    This is how i finish my activities on back

     LocalActivityManager m = getLocalActivityManager();
     Intent i = intentStack.pop();
     m.destroyActivity(i.getStringExtra("UniqueID"),true);
    

    the intentStack is just where i keep the intent stack so i can find those activities again.

    That should be what you need but regardless you should re-evaluate your need to use TabActivity/ActivityGroup as that class and all subclasses has been deprecated as of 2.2 or 2.3. You should consider moving to fragments and using the support library.

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

Sidebar

Related Questions

I have an Android application (java) that was working fine when compiled with the
Java or .NET answers are fine. I create an Android Map with the following,
Thanks for your answers to my previous question about GUI in java . I
This code is works fine when you type 22 and 56 for example, it
I have simple java app that prints `hello world!' on console. It is packed
I have updated this question(found last question not clear, if you want to refer
I want my Java program to use the system's proxy configuration. Accordingly, I used
i was asked a few java interview questions which i had no idea how
In java <1.5, constants would be implemented like this public class MyClass { public
I'm new to java and I'm trying to run a method once a button

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.