I am getting the error:
05-14 15:06:13.124:
ERROR/AndroidRuntime(2218): Caused by:
java.lang.RuntimeException: Could not
create tab content because could not
find view with id 123
Why can i not do something like this? What am i missing? Here is the code, basically an RSSview is an extended scrollview with a table layout and rss processor (built programmatically)
final BrRSSView newsView = new BrRSSView(currentActivity,rss);
newsView.setId(123);
tabHost.addTab(
tabHost.newTabSpec("tab1")
.setIndicator("Nyheter", getResources().getDrawable(R.drawable.icons_tab_nyheter))
.setContent(123));
I think the problem is that the
TabHostonly looks for the view id inside thetabcontentview. If you still want to do this via code, you can add your view to thetabcontentview and then run theaddTab()method.