I have an issue I have not been able to figure out and it is only happening on devices running <2.1. It works fine on android 2.2. I have ansynchronous task that displa
TabSpec firstTabSpec = tabHost.newTabSpec("tid1");
TabSpec secondTabSpec = tabHost.newTabSpec("tid1");
TabSpec thirdTabSpec = tabHost.newTabSpec("tid1");
Are you allowed to use the same 'tag' for more than one TabSpec? I'd try setting those correctly and see if it fixes it.
EDIT: OK, so my suggestion didn't fix it but it makes sense to have unique tags anyway.
Try this to see if it helps. Add an option to set the currently selected tab at the end of your LoadLayout() method like so (see last line)...
/* Add tabSpec to the TabHost to display. */
tabHost.addTab(firstTabSpec);
tabHost.addTab(secondTabSpec);
tabHost.addTab(thirdTabSpec);
tabHost.setCurrentTab(0); // <== Add this
EDIT2: I found the TabWidget.java source and line 206 (where the NullPointerException occurs) is...
mBottomLeftStrip.setState(selectedChild.getDrawableState());
...there are three possible causes of the exception that I can see.
selectedChild.getDrawableState()
is nullThe last seems to be the likely cause but I'm not sure what could cause it to return null.
Try Google for 'TabWidget.java source' - the second result points at grepcode.com which has line numbers and you can see what it's trying to do at the point of the exception.