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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:21:48+00:00 2026-05-26T19:21:48+00:00

I have created a custom tabbar in my application (using TabHost and TabWidget ).

  • 0

I have created a custom tabbar in my application (using TabHost and TabWidget). However in my TabActivity I want to invoke a method of the Activity that is currently selected.
Here is a sample of how I initialize the tab bar:

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.tabbar);

        TabHost tabHost = getTabHost();
        Intent content;
        Button tabView;
        TabSpec tab;

        content = new Intent(this, Test1.class);
        tabView = new Button(getApplicationContext());
        tabView.setBackgroundDrawable(getResources().getDrawable(R.drawable.btn_tableft_selector));
        tabView.setText("Test1");
        tabView.setTypeface(font);
        tabView.setTextColor(Color.WHITE);
        tabView.setPadding(0, 2, 0, 0);
        tab = tabHost.newTabSpec("test1").setIndicator(tabView).setContent(content);
        tabHost.addTab(tab);

        ...
    }

My problem is that in my TabActivity and in all 3 tabs I want to receive LocationUpdates, but I need to do some validation before delivering the location updates to the tab’s Activity.
What I wanted to do is receive location updates in my TabActivity, do the processing and then invoke some method in the current tab Activity, however I can’t access it from the tabHost. Is there a way to do this?

  • 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-26T19:21:48+00:00Added an answer on May 26, 2026 at 7:21 pm

    if they are all activities then you can use the ActivityGroup stuff since TabActivity extends ActivityGroup. You will need to define a location interface or something that all your activities implement to avoid crashes, or do checks. Also if your not too far along yet you should consider using the compatibility library and using fragments, as tabactivity and activitygroup have been deprecated

     LocalActivityManager m = getLocalActivityManager();
     ((LocationInterface)m.getCurrentActivity()).sendLocation();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a custom workflow activity that copies attachments from a case to
friends, i have created custom title bar using following titlebar.xml file with code <?xml
I have created a custom dialog for Visual Studio Setup Project using the steps
I have created a custom tag that looks like this: def textField = {
We have created custom listview by using the Base adapter. List view contains Text
I have created custom result class to serialize json data to xml. I want
I have created a Custom Edit Form for a custom list using SharePoint designer.
I have created a custom scrollable tabbar [scrollview with buttons over it] below navigationcontroller.
I have created a custom DNN module with 2 .ascx files that I have
I have created a custom class for my Android project called Sounds I want

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.