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

  • Home
  • SEARCH
  • 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 6104813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:53:05+00:00 2026-05-23T13:53:05+00:00

Here’s the code: public class MenuTabActivity extends TabActivity implements OnTabChangeListener{ @Override protected void onCreate(Bundle

  • 0

Here’s the code:

public class MenuTabActivity extends TabActivity implements OnTabChangeListener{

@Override   
protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.menu_layout);

    TabHost tb = getTabHost();

    TabHost.TabSpec spec = null;
    Intent intent = null;

    // My Profile tab
    intent = new Intent(this, MyProfileActivityGroup.class);

    View myProfileView = LayoutInflater.from(this).inflate(R.layout.button_profil, null);
    spec = tb.newTabSpec("0").setIndicator(myProfileView).setContent(intent);
    tb.addTab(spec);

    // Driving tab
    intent = new Intent(this, DrivingActivityGroup.class);
    View drivingView = LayoutInflater.from(this).inflate(R.layout.button_conduite, null);
    spec = tb.newTabSpec("1").setIndicator(drivingView).setContent(intent);
    tb.addTab(spec);

    // Score Tab
    intent = new Intent(this, ScoreActivityGroup.class);
    View scoreView = LayoutInflater.from(this).inflate(R.layout.button_score, null);
    spec = tb.newTabSpec("2").setIndicator(scoreView).setContent(intent);
    tb.addTab(spec);

    // Advices Tab
    intent = new Intent(this, AdvicesActivity.class);
    View advicesView = LayoutInflater.from(this).inflate(R.layout.button_conseils, null);
    spec = tb.newTabSpec("3").setIndicator(advicesView).setContent(intent);

    tb.addTab(spec);
    tb.setOnTabChangedListener(this);
    Main.tabBar = tb;
    tb.setCurrentTab(0);
}

@Override
public void onTabChanged(String tabId) {

    if (tabId.equals("2")){

        //refresh third tab
        ((ScoreActivityGroup)(getLocalActivityManager().getActivity(tabId))).getScoreActivity().updateView();
    }

    if (tabId.equals("1")){ //driving activity

        if (Utils.tabImage == null) {

            //create the static image of the tabbar here
            Bitmap tabImage = Bitmap.createBitmap(getTabHost().getTabWidget().getWidth(), getTabHost().getTabWidget().getHeight(), Bitmap.Config.RGB_565);
            getTabHost().getTabWidget().draw(new Canvas(tabImage));
            Utils.tabImage = tabImage;
        }

        //load second "tab" Activity
        ((DrivingActivityGroup)(getLocalActivityManager().getActivity("1"))).startDrivingActivity();
    }

    if (!tabId.equals("2")){

        if (getLocalActivityManager().getActivity("2") != null){

            if (((ScoreActivityGroup)getLocalActivityManager().getActivity("2")).getCurrentActivity() instanceof ScoreDetailsActivity){

                //dismiss Conseil Dialog if it exists
                ((ScoreDetailsActivity)(((ScoreActivityGroup)getLocalActivityManager().getActivity("2")).getCurrentActivity())).dismissConseilDialog();
            }
        }
    }
}

/**
 * This method starts an activity with a given animation (ex: bottom-top)
 * Used for info activities
 * 
 * This action is placed here because the animations are ignored if done
 * from child activities of the MenuTabActivity.
 * 
 * @param clazz
 * @param enterAnim
 * @param exitAnim
 * @param intentExtra
 */
public void startActivityWithOverridePendingTransition(Class<?> clazz, int enterAnim, int exitAnim, Integer intentExtra){
    final Intent intent = new Intent(this, clazz);
    if ( intentExtra !=  null ){
        intent.putExtra("com.renault.Intent", intentExtra);
    }
    startActivity(intent);
    overridePendingTransition(enterAnim, exitAnim);
}

public void onDestroy(){
    super.onDestroy();

    if (Main.monitoringHasStarted) {

        Main.DriveBusinessService.stopMonitoring();
        ScoringModelPojo.saveToBundle(getApplicationContext());
    }

    Main.monitoringHasStarted = false;

    SettingsModel.saveToBundle(getApplicationContext());
}

}
`

Here’s the tabwidget:

<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" 
            android:layout_weight = "1"/>
        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background = "@color/grayFond" 
            android:layout_weight = "0"/>
    </LinearLayout>
</TabHost>

Did any of you come across the issue mentioned in the title?

  • 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-23T13:53:06+00:00Added an answer on May 23, 2026 at 1:53 pm

    I found out what was wrong. It must be a bug in there. In the manifest file I had no status bar and full screen. When introducing the status bar back into the screen, (NO FULLSCREEN) it worked as it should. Maybe this helps someone.

    PS. This should be filed as a bug with ANDROID. (tested in 2.1)

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

Sidebar

Related Questions

Here's my test function (c#, visual studio 2010): [TestMethod()] public void TestGetRelevantWeeks() { List<sbyte>
Here is my code, which takes two version identifiers in the form 1, 5,
Here's the top of my usercontrol: <UserControl x:Class=MyApp.Common.Controls.Views.SimpleView xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns:mc=http://schemas.openxmlformats.org/markup-compatibility/2006 xmlns:d=http://schemas.microsoft.com/expression/blend/2008 xmlns:Framework=http://www.memoryexpress.com/UIFramework mc:Ignorable=d
here are 2 screen shots when i try to debug my code in visual
Here is my simplified data structure: Object1.h template <class T> class Object1 { private:
Here a simple question : What do you think of code which use try
Here's a basic regex technique that I've never managed to remember. Let's say I'm
Here's a problem I ran into recently. I have attributes strings of the form
Here is the issue I am having: I have a large query that needs
Here's my scenario - I have an SSIS job that depends on another prior

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.