{"id":149,"date":"2015-08-08T16:58:41","date_gmt":"2015-08-08T16:58:41","guid":{"rendered":"http:\/\/rat32.com\/rat32\/?p=149"},"modified":"2015-09-03T07:10:40","modified_gmt":"2015-09-03T07:10:40","slug":"solution-to-tabhost-inside-a-navigationdrawer-not-updated-after-orientation-changes","status":"publish","type":"post","link":"http:\/\/rat32.com\/rat32\/2015\/08\/08\/solution-to-tabhost-inside-a-navigationdrawer-not-updated-after-orientation-changes\/","title":{"rendered":"Solution to &#8220;Tabhost Inside a navigationDrawer not updated after orientation changes&#8221;"},"content":{"rendered":"<p>I came across another weird problem that i had <strong>TabHost<\/strong> inside <strong>Navigation Drawer<\/strong> and it works fine when loaded but while i change the orientation of the Android Device it displays nothing(..there might be the same case for other configuration changes as well). <\/p>\n<p>There is a simplest solution to this. You need to change  <strong>FragmentPagerAdapter<\/strong> instead of <strong>FragmentStatePagerAdapter<\/strong> in your <strong>TabHost<\/strong> class.<\/p>\n<p>i.e. Change<br \/>\n    \t\tpublic static class TabsAdapter extends FragmentPagerAdapter implements TabHost.OnTabChangeListener, ViewPager.OnPageChangeListener<\/p>\n<p>to <\/p>\n<p>\t\tpublic static class TabsAdapter extends FragmentStatePagerAdapter implements TabHost.OnTabChangeListener, ViewPager.OnPageChangeListener<\/p>\n<p>Hope this Helps!!!<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>I came across another weird problem that i had TabHost inside Navigation Drawer and it works fine when loaded but while i change the orientation of the Android Device it displays nothing(..there might be&#46;&#46;&#46;<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73,7],"tags":[75,77,76,74],"class_list":["post-149","post","type-post","status-publish","format-standard","hentry","category-android","category-how-to","tag-navigation-drawer","tag-onconfigurationchange","tag-orientation-change","tag-tabhost"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"http:\/\/rat32.com\/rat32\/wp-json\/wp\/v2\/posts\/149"}],"collection":[{"href":"http:\/\/rat32.com\/rat32\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/rat32.com\/rat32\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/rat32.com\/rat32\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/rat32.com\/rat32\/wp-json\/wp\/v2\/comments?post=149"}],"version-history":[{"count":1,"href":"http:\/\/rat32.com\/rat32\/wp-json\/wp\/v2\/posts\/149\/revisions"}],"predecessor-version":[{"id":150,"href":"http:\/\/rat32.com\/rat32\/wp-json\/wp\/v2\/posts\/149\/revisions\/150"}],"wp:attachment":[{"href":"http:\/\/rat32.com\/rat32\/wp-json\/wp\/v2\/media?parent=149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/rat32.com\/rat32\/wp-json\/wp\/v2\/categories?post=149"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/rat32.com\/rat32\/wp-json\/wp\/v2\/tags?post=149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}