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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:23:05+00:00 2026-05-25T03:23:05+00:00

I have 2 tabs with tagID tag01 and tag02. I have explicitly set the

  • 0

I have 2 tabs with tagID “tag01” and “tag02”. I have explicitly set
the focus to first tab by calling tabHost.setCurrentTab(0)

When i call getLocalActivityManager().getActivity("tag01") i get the
object of activity but when i call

getLocalActivityManager().getActivity("tag02") then i get NULL.
//Log.i("tab status: ", getLocalActivityManager().getActivity("tag02")+""); prints null
//Log.i("tab status: ", getLocalActivityManager().getActivity("tag01")+""); prints com.test.TestActivity@437c06c8

Now when i again run my app and this time click second tab and then
getLocalActivityManager().getActivity("tag02") gives object
(toString() in logcat).
So after checking it again and again i found that “only activity in
first tab( that i had set focus explicitly by
tabHost.setCurrentTab(0)) returns non-null” and other tabs return null
unless u don’t click those tab.
When i click all tabs i.e atleast i go through all tabs by clicking
them then getLocalActivityManager().getActivity(anyTag) returns
object(i am tracing toString()) . How to access activity from other
tabs without clicking other tabs because user won’t know that he/she
has to click tabs.
Please give some suggestions. Because i have to access activity in
tabs in my app.
I hope you understood my problem.

thanks

  • 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-25T03:23:06+00:00Added an answer on May 25, 2026 at 3:23 am

    The activity is not created!

    if you have n tabs You could do this in your onCreate():

    for(int i=n-1;i>0;i--)
        tabHost.setCurrentTab(i);
    

    In this way, the tab displayed is the first tab (with index 0) and getLocalActivityManager().getActivity(anyTag) will return non-null

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

Sidebar

Related Questions

I have 3 tabs, created by js. Active tab has class named active and
I have a tabs as views in my activity. Each tab represents a ListView
I have three tabs. When I press the tab button on the bottom, is
I need little bit help related to android tabhost. I have 3 tabs and
I have tabs on my website, but sometimes the tab doesn't contain any info
I have the following code in my background script: chrome.tabs.onUpdated.addListener(function(tabId, changeinfo, tab) { if
I have tabs that when tapped will show a view for each tab. Is
I have tabs in JavaFX and I want to set a style to remove
I have a jQuery dialog that holds multiple tabs, each tab contains a form,
I am creating a web application using backbone.js. I have two tabs. Tab 1

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.