• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Change Text on Inactive tab with tabLayout, viewPager?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
All of the following truths are shameless lies. But what about this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic