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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:44:18+00:00 2026-05-31T10:44:18+00:00

I am using this code . private ViewGroup createTabbarView() { bookedZone = None; bookedStand

  • 0

I am using this code .

private ViewGroup createTabbarView() {

        bookedZone = "None";
        bookedStand = "None";

        tabHost = new TabHost(this, null);
        tabHost.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));

        Button btn = new Button(this);
        btn.setText("Emergency");
        tabHost.addView(btn, new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));

        tabWidget = new TabWidget(this);
        tabWidget.setId(android.R.id.tabs);
        tabHost.addView(tabWidget, new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));

        FrameLayout frameLayout = new FrameLayout(this);
        frameLayout.setId(android.R.id.tabcontent);
        frameLayout.setPadding(0, 100, 0, 0);
        tabHost.addView(frameLayout, new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); // WRAP_CONTENT

        tabHost.setOnTabChangedListener(new OnTabChangeListener() {

            public void onTabChanged(final String tabId) {
                if (tabId.equalsIgnoreCase("TripList")
                        && (AVL_Service.pref.getBoolean("BluetoothMeter", false) || AVL_Service.pref.getBoolean("VivotechDevice", false) || AVL_Service.pref.getBoolean(
                                "BlueBambooDevice", false))) {
                    if (mBluetoothAdapter == null)
                        mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
                    final Context tempContext = getBaseContext();
                    if (mBluetoothAdapter == null) {
                        // Device does not support Bluetooth
                        Log.d(getClass().getSimpleName(), "Bluetooth not supported.");
                        Toast.makeText(tempContext, "Bluetooth not supported!", Toast.LENGTH_LONG).show();
                    } else {
                        if (!mBluetoothAdapter.isEnabled()) {
                            Log.d(getClass().getSimpleName(), "Bluetooth not enabled.");
                            Toast.makeText(tempContext, "Bluetooth not enabled, trying to enable", Toast.LENGTH_LONG).show();
                            Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
                            startActivityForResult(enableBtIntent, Constants.REQUEST_ENABLE_BT);
                            // tabHost.getTabWidget().getChildAt(ZoneIndex).requestFocusFromTouch();
                        } else {

                            Message lmsg = new Message();
                            lmsg.obj = null;
                            lmsg.what = MsgType.TabberClick;
                            msgHandler.sendMessageDelayed(lmsg, 1000);

                        }// if bluetooth enabled
                    }// if bluetooth not supported
                }// if Bluetooth connection required
                else if (tabId.equalsIgnoreCase("Status")) {
                    setMeterStatus();
                }
            }// onTabChanged
        });

        tabHost.setup();

        // Status Tab
        TabSpec tabSpec = tabHost.newTabSpec("Status");
        tabSpec.setIndicator("Status", getResources().getDrawable(R.drawable.status));
        tabSpec.setContent(new TabContentFactory() {
            @Override
            public View createTabContent(String arg0) {

                return createStatusView();
            }
        });
        tabHost.addTab(tabSpec);

        // Zones Tab
        tabSpec = tabHost.newTabSpec("Zones");
        tabSpec.setIndicator("Zones", getResources().getDrawable(R.drawable.zones));
        tabSpec.setContent(new TabContentFactory() {

            @Override
            public View createTabContent(String arg0) {

                return createZoneView();
            }
        });
        tabHost.addTab(tabSpec);

        // Bids Tab
        bidTab = tabHost.newTabSpec("Bids");
        bidTab.setIndicator("Bids", getResources().getDrawable(R.drawable.icon + bidCount));
        bidTab.setContent(new TabContentFactory() {

            @Override
            public View createTabContent(String arg0) {

                return createBidsView();
            }
        });
        tabHost.addTab(bidTab);

        // TripList Tab
        tabSpec = tabHost.newTabSpec("TripList");
        tabSpec.setIndicator("TripList", getResources().getDrawable(R.drawable.triplist));
        tabSpec.setContent(new TabContentFactory() {

            @Override
            public View createTabContent(String arg0) {

                return createManifestView();
            }
        });
        tabHost.addTab(tabSpec);

        return tabHost;
    }

// Tabber View

But this button hides the tabs of Tabber view. I want to add to add this button above tabber view. Plz help me..I am in great trouble.
Regards.

  • 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-31T10:44:20+00:00Added an answer on May 31, 2026 at 10:44 am

    So basically you want a button (or buttons) that is above the TabWidget tabs regardless of which tab is selected?

    Just change your layout file to something similar to this (pseudo-code)…

    <?xml version="1.0" encoding="utf-8"?>
    <TabHost xmlns:android="http://schemas.android.com/apk/res/android"
        ... >
        <LinearLayout
            android:orientation="vertical"
            ... >
            <LinearLayout
                android:orientation="horizontal"
                ... >
                <Button
                    ... />
            </LinearLayout>
            <TabWidget
                android:id="@android:id/tabs"
                ... />
            <FrameLayout
                android:id="@android:id/tabcontent"
                ... >
                ...
            </FrameLayout>
        </LinearLayout>
    </TabHost
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found this code using Google. private int RandomNumber(int min, int max) { Random
I am using this piece of code (the port used is 995) : Private
I am using this code: private void Form1_Load(object sender, EventArgs e) { } private
Basically I want to broadcast and receive every 5 seconds using this code: private
I am serializing an structure by using BinaryFormatter using this code: private void SerializeObject(string
I am populating a treeview control, c# visual studio 8, using this code: private
I'm using this code, to make a request to a given URL: private static
Using this code to zip a folder and it works perfect on small files
Using this code var html='<div class=somediv></div>'; var target=document.getElementById('contentArea'); target.appendChild(html); I'm getting Uncaught Error: NOT_FOUND_ERR:
Using This code: I am tring to fill the page with the data and

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.