使用clearAllTabs()这个方法删除tab的后,然后再添加 tab 就会抛 nullPointmentException下面的资料说是android 的bug  http://code.google.com/p/android/issues/detail?id=2772调用这个 clearAllTabs()这个方法的前需要 调用 tabHost.setCurrentTab(0);tab的下标设置为0,但是这样的话每次更新tab里的内容都会显示第一个tab,这是不爽的地方。又查了一下资料http://www.coderanch.com/t/460859/Android/Mobile/TabHost-Remove-Tab里面谈到了另外一个方法,测试没通过还是抛 NullPointException   1. // data structure, what I referred to as memory  
   2. ArrayList<TabHost.TabSpec> list = new ArrayList<TabHost.TabSpec>();  
   3.   
   4. // when you are adding tabs to tab host  
   5. // what you add, you remember  
   6. TabHost.TabSpec spec = tabs.newTabSpec("tag1");  
   7. spec.setContent(R.id.button);  
   8. spec.setIndicator("TabONe");  
   9. tabs.addTab(spec);  
  10. list.add(spec);  
  11. ...  
  12. // when you want to remove  
  13. list.remove(list.size()-1); // remove it from memory  
  14. tabs.clearAllTabs();  // clear all tabs from the tabhost  
  15. for(TabHost.TabSpec spec : list) // add all that you remember back  
  16.    tabs.addTab(spec);  哪位路过的大侠是否有好的解决方案,谢谢了