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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:30:23+00:00 2026-05-18T12:30:23+00:00

I have used tabbar with activity group in my application. I have four tab

  • 0

I have used tabbar with activity group in my application. I have four tab like home, stock, citn, article. In my application first display home page from the home page user click in webview it will go to homepage1 activity. From home page1 activity user click stock tab it will go to stock activity. From the stock activity user click home tab it will go to homepage1 activity. I want to display home activity can any body tell how to do?

My question is switching between tab using activity group it will display last activity. I want to display first activity?

ok i will attach my code

spec = tabHost.newTabSpec("FirstGroup").setIndicator("FirstGroup",   
                getWallpaper()).setContent( new Intent(this,FirstGroup.class));
        tabHost.addTab(spec);   

View view =
getLocalActivityManager().startActivity(“CitiesActivity”,
new
Intent(this,CitiesActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET
)).getDecorView();

          // Replace the view of this ActivityGroup   
      replaceView(view);   

   }   

public void replaceView(View v) {   
            // Adds the old one to history   
    history.add(v);   
            // Changes this Groups View to the new View.   
    setContentView(v);

run this example
http://united-coders.com/nico-heid/use-android-activitygroup-within-tabhost-to-show-different-activity

switching between activity and tab

I have posted in pastebin, my link is
http://pastebin.com/1zG0HJgv

  • 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-18T12:30:24+00:00Added an answer on May 18, 2026 at 12:30 pm

    Hi Did u tried the tabchanged event as shown below

    tabHost.addTab(tabHost.newTabSpec("tab1").setContent(
                    R.id.content_movies).setIndicator("",
                    getResources().getDrawable(R.drawable.icon)));
            tabHost.addTab(tabHost.newTabSpec("tab2").setContent(
                    new Intent(this, Sample.class)).setIndicator("",
                    getResources().getDrawable(R.drawable.menu_icon)));
        tabHost.setOnTabChangedListener(new TabHost.OnTabChangeListener() {
    
           @Override
           public void onTabChanged(String arg0) {
    
    
             if(arg0.equals("tab1"))
            {
    
           /*write the code here to show the view 
         Currentclass, the class where you have used ontabchanged function and 
         Newclass is the class where you want to navigate*/
               Intent obj_intent = new Intent(CureentClass.this,Newclass.class);
        startActivity(obj_intent);
    
            }
    
            else if (arg0.equals("tab2")) {
    
                     // write the code here to show the view 
           }
           //similarly for other tabs
          });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used 4 tabs.I want show tabbar in all activity so i used
I used a TabBar in my iPhone application and integrated it programmatically. I have
I have used the Tab Bar Application in New Project in Xcode. In IB,
I have a tabcontrol used to display multiple image files in an application. I
I have four tabs in tabbar. Whenever I launch my application I need to
I have used the following article as a guide to creating a custom EditorPart
In a tab bar based application, If I have one controller pushed in the
I have a tab bar app but the first tab is an image with
I have a Tab bar application with two tabs named Tab1 and Tab2. Whenever
I have an application with several view controllers controlled from a tab bar controller.

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.