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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:46:22+00:00 2026-05-22T14:46:22+00:00

I have a question about Honeycomb’s backward compatibility. I have an app that supports

  • 0

I have a question about Honeycomb’s backward compatibility. I have an app that supports 2.1 or higher and seems to mostly work on Honeycomb except when they start a TabActivity.

In particular, when I add tabs to the TabHost, I get the following exception

android.content.res.Resources$NotFoundException: Resource ID #0x0

When looking at the code that throws this exception, I see that it’s the tab spec that has a label and an icon. Inside the code, in the LabelAndIconIndicatorStrategy tries to inflate the layout file R.layout.tab_indicator which doesn’t appear to be available.

    TabHost.TabSpec spec; // Resusable TabSpec for each tab
    Intent intent; // Reusable Intent for each tab

    // Create an Intent to launch an Activity for the tab (to be reused)
    intent = new Intent().setClass(_gameActivity, ScoreGameActivity.class);
    intent.putExtra(GameChangerConstants.STREAM_ID, _stream.pk().toString());

    // Initialize a TabSpec for each tab and add it to the TabHost
    spec = _gameTabHost.newTabSpec("score_game").setIndicator("Score", res.getDrawable(R.drawable.icon_field_gloss)).setContent(intent);
    _gameTabHost.addTab(spec);

Is there a new way of creating tabs for honeycomb that I don’t know about? I’ve poured over the documentation but haven’t seen anything that indicates a problem with what I’ve done.

I’d like to avoid having to use fragments at this point until we can do a more comprehensive restructuring of our UI widgets and I’d like to better understand this issue.

  • 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-22T14:46:23+00:00Added an answer on May 22, 2026 at 2:46 pm

    I believe I’ve found a solution, but because people are curious, here is the stacktrace I got when I ran into this problem:

    05-17 13:09:53.462: ERROR/CustomExceptionHandler(500): Uncaught throwable in thread Thread[main,5,main]
        android.content.res.Resources$NotFoundException: Resource ID #0x0
        at android.content.res.Resources.getValue(Resources.java:1014)
        at android.content.res.Resources.loadXmlResourceParser(Resources.java:2039)
        at android.content.res.Resources.getLayout(Resources.java:853)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:389)
        at android.widget.TabHost$LabelAndIconIndicatorStrategy.createIndicatorView(TabHost.java:568)
        at android.widget.TabHost.addTab(TabHost.java:226)
        at com.myApp.ui.TabDialog.addTab(TabDialog.java:80)
        ...
    

    At that line, I have code roughly equivalent to what sparky saw:

    spec = myTabHost.newTabSpec("score_game").setIndicator("Score", res.getDrawable(R.drawable.icon_field_gloss)).setContent(intent);
    myTabHost.addTab(spec);
    

    Note that myTabHost is a TabHost and spec is a TabSpec.

    Previously, I was initializing myTabHost like this:

    //WRONG - This can CRASH your app starting at Android SDK 3.0
    TabHost myTabHost = new TabHost(getContext()); 
    

    To fix this problem, I started initializing the TabHost by doing this:

    TabHost myTabHost = new TabHost(getContext(), null); 
    

    And that fixed it! I would love to find a root cause, but I haven’t yet been able to figure it out.

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

Sidebar

Related Questions

I have question about database optimizing, indexing. I have table that called projects and
I have question about throw. How will the throw work in the following code?
Have a question about full text search. I have a query that works, but
https://stackoverflow.com/a/64983/468251 - Hello, I have question about this code, how made that working with
I have a question about design. I have a series of generic functions that
I have question about normalization. Suppose I have an applications dealing with songs. First
I have question about interpreting strings as packed binary data in C++. In python,
i have question about YAJLiOS parser... I have next json data : {{ body
I have a question about whether or not a specific way of applying of
I have a question about django content_types In the example of filtering a QuerySet

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.