I have an application with a Navigation Drawer that has 6 fragments. The first fragment is the MainFragment. MainFragment has 4 fragments. In the MainActivity, an AsyncTask(MyTask) is set up which changes the text in the OneFragment(Common) and in the ThirdFragment(Internal) of MainFragment. My question is: this AsyncTask can not change tex on TextView on this tabs(Common and Internal). How to fix it. What I did: changing text on TextView works if the Common(FragmentOne) tab is activated with method TabLayout.getTabAt(0).select () and the Internal(FragmentThree) tab with tabLayout.getTabAt(2).select(). But this is not acceptable. I do not know of other ways. How to do this without tabLayout.getTabAt(0).select() and tabLayout.getTabAt(2).select() The source code is attached. MainActivity MainFragment FragmentOne(Common) FragmentTwo(Battery) FragmentThree(Internal) FragmentFour(Internal) FragmentFirst FragmentSecond .... FragmentSix
Source Code Zip archive