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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:19:34+00:00 2026-06-04T10:19:34+00:00

I am implementing the solution for TabActivity with activities in the TabHost as described

  • 0

I am implementing the solution for TabActivity with activities in the TabHost as described at http://ericharlow.blogspot.com/2010/09/experience-multiple-android-activities.html. I realize this is sub-optimal but I am already down this road pretty far and have only one remaining hiccup. I have a need to pop to the top of the stack that I am managing (using a list of String for activity ID) and I know that I can get this activity using:

Activity current = getLocalActivityManager().getActivity(mIdList.get(0));

However, I do not know of a method for “showing” current.

I know that I can do this:

Activity current = getLocalActivityManager().getActivity(mIdList.get(1))
current.finish();

And this will have the desired result in the case of there being at least two activities on the stack. However, when there is only one, it fails very badly with an ArrayOutOfBoundsException.

How can I “show” a given activity?

  • 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-04T10:19:35+00:00Added an answer on June 4, 2026 at 10:19 am

    Try this way to start an activity which is always at the top in Activity Stack:

    List<ActivityManager.RunningTaskInfo> processes1 = activityManager.getRunningTasks(1);
    ComponentName componentInfo = processes1.get(0).topActivity;
    String classname =processes1.get(0).topActivity.getClassName(); 
    String packagename = processes1.get(0).topActivity.getPackageName();
    if(classname.equalsIgnoreCase("com.YOUR_PACKAGE_NAME..YOURACTIVITY_NAME"))
        {
            Intent intent24 = new Intent(Intent.ACTION_MAIN).addCategory(
            Intent.CATEGORY_LAUNCHER).setClassName("YOUR_PACKAGE_NAME",
            "com.YOUR_PACKAGE_NAME..YOURACTIVITY_NAME").addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
            .addFlags(Intent.FLAG_FROM_BACKGROUND).setComponent(new ComponentName("YOUR_PACKAGE_NAME",
            "com.YOUR_PACKAGE_NAME..YOURACTIVITY_NAME"));
            getApplicationContext().startActivity(intent24);
        }
        else
        {
         //DONE SOMETHING HERE...
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am implementing the solution described here in a MVVM project: http://nui.joshland.org/2010/04/why-wont-wpf-controls-work-with-touch.html But the
We're implementing a new solution in our classic ASP environment that's using COM interop
We are currently implementing a solution where we have a collection which we want
I'm thinking about a good solution for implementing a sign up/login system that works
I'm implementing a solution in ASP.NET MVC that later can be applied to couple
I have tried to find out the working solution for implementing simple events booking
I am implementing a solution in Solr where I have a lot of values
We are implementing MDM solution in house. We have registered as MDM vendor and
I am implementing ranking solution for one of my tables to optimize read queries
I'm implementing a solution to drag an element from a container to another. Until

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.