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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:13:51+00:00 2026-05-22T21:13:51+00:00

i have Tab host which is shown below, private TabHost myTabHost; …… setContentView(R.layout.vidtab); Intent

  • 0

i have Tab host which is shown below,

 private TabHost myTabHost;

......    

    setContentView(R.layout.vidtab);


    Intent intent=getIntent(); 


    intent = new Intent().setClass(this, RecordActivityGroup.class);
    myTabHost = (TabHost)this.findViewById(android.R.id.tabhost);
    myTabHost.setup();
    TabSpec rectab = myTabHost.newTabSpec("Record");
    rectab.setIndicator("Record",getResources().getDrawable(R.drawable.irecord));
    rectab.setContent(intent);

    myTabHost.addTab(rectab);
   intent = new Intent().setClass(this, sharingProject.class);

    TabSpec setting = myTabHost.newTabSpec("Hint");
    setting.setIndicator("Hint",getResources().getDrawable(R.drawable.isettings));
    setting.setContent(intent);

    myTabHost.addTab(setting);

in that record Activity group i have following code,

RecordActivityGroup extends TabGroupActivity{

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    startChildActivity("RecordingActivity", new Intent(this,Record.class));



}

and Record.class is an activity which contain one button, i need to switch to second tab while clicking button in Record class, how to do that? i any one know that please help me out.

  • 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-22T21:13:52+00:00Added an answer on May 22, 2026 at 9:13 pm

    You can use an method in your main class like following

    public void switchToTab(int tabid){
                myTabHost.setCurrentTab(tabid);
    }
    

    And now in Record class on your Button click call this

            YourStartCalss parentActivity;
            parentActivity= (YourStartCalss) this.getParent();
            parentActivity.switchToTab(yourtabid);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 2 tab items. In tab No.1 I have a control which corresponds
I need to implement tabs in my project.i have a layout, in which i
I have a TabHost, and each of my tabs are individual views which look
I have created an tab host..what i want to do is to change the
For example, i have 3 activities.. I also use Tab host with separate activity
I have tabhost with 4 tabs. If I (for example) open tab #3, start
I'm a bit puzzeled, I have an application which has 5 tabs in tabHost.
In my application I have a tab bar. It contains four tabs in which
Today I have just thrown together this PowerShell script which takes a tab-delimited text
I need to have a TabHost consisting of two tabs where each tab represented

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.