I have a question about Honeycomb backward compatibility. I have an application that supports 2.1 or higher, and it seems to work mostly on Honeycomb, unless they launch TabActivity.
In particular, when I add tabs to 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 this is a tab specification that has a label and icon in it. Inside the code in LabelAndIconIndicatorStrategy is trying to inflate the R.layout.tab_indicator layout file, which seems to be unavailable.
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 to create tabs for honeycombs that I donβt know about? I poured the documentation, but did not see anything that indicates a problem with what I did.
I would like to avoid using fragments at this stage until we can do a more complete restructuring of our user interface widgets, and I would like to better understand this problem.
source share