I have a tabhost that contains 5 tab (Monday .... Friday). I want to change the indicators dynamically from other activities (using a button) Does any one have a solution Thanks in advance
How Do I change the indicator of a tabhost dynmaicly from an other activity
1.7k Views Asked by Aminos At
2
There are 2 best solutions below
0
Veeresh
On
Get a hold of the tabIndicator View. It usually consists of an ImageView and a TextView unless you have your own custom TabIndicator.
ViewGroup tabInidcator = tabHost.getTabWidget().getChildTabViewAt('the index of tab you want to change')
The textView inside the relative layout is currently the 2nd child (careful this might change) unless you have a custom tabIndicator view.
TextView tabIndicator = (TextView) tabIndicator.getChildAt(1);
indicator.setText("thunday");
If you want to change the image get the imageView at location 0
Related Questions in ANDROID
- Delay in loading Html Page(WebView) from assets folder in real android device
- MPAndroidChart method setWordWrapEnabled() not found
- Designing a 'new post' android activity
- Android :EditText inside ListView always update first item in the listview
- Android: Transferring Data via ContentIntent
- Wrong xml being inflated android
- AsyncTask Class
- Unable to receive extras in Android Intent
- Website zoomed out on Android default browser
- Square FloatingActionButton with Android Design Library
- Google Maps API Re-size
- Push toolbar content below statusbar
- Android FragmentPagerAdapter Circular listview
- Layout not shifting up when keyboard is open
- auDIO_OUTPUT_FLAG_FAST denied by client can't connect to localhost
Related Questions in DYNAMIC
- Convert Apache VirtualHost to nginx Server Block for Dynamic Subdomains
- Nested dynamically generated forms using jQuery
- AngularJS Dynamic Slider Control
- dynamic content control mapping for MS word c#
- get value from the dynamic create textbox
- Android : Unable to change width of dynamic button
- saving matlab file (.mat) with dynamic name
- MODx Create dynamic frontend page / display manager page without login
- Dynamic XML parsing, data storage, and forms in c#
- Cannot convert type 'Umbraco.Core.Dynamics.DynamicNull' to 'Umbraco.....' - Umbraco v6
- IDynamicMetaObjectProvider set property using literal name
- PHP unable to load dynamic library
- How to use Dynamic Variables?
- How can call method dynamically in c#
- Make divs inside table cells the same height without javascript
Related Questions in ANDROID-TABHOST
- Android tabwidget each tab text
- Android TabHost Default Tab: First Added Tab Is Always Created
- How to highlight a Tab when Notification received
- how to add icon and Image in Tabhost android?
- How to pass data between multiple Fragments in Android
- Android Tabwidget change Textview color programatically
- FragmentTabHost from Navigation Drawer
- Tab with icon using TabLayout in Android Design Library
- TabHost not working upon multiple Tab switches
- Handling tab press inside a activity group to do back press functionality
- App crash on TabHost on some devices only for Android 4.0.3-4.0.4
- TabHost displays content once (onCreate)
- Cannot resolve constructor Intent
- Tabhost inside Fragment not working
- How to set Android toolbar height?
Related Questions in INDICATOR
- SSRS Indicator that will look for both date and hour
- Opening the Indicator in Multiple Charts
- SSRS report with directional indicator - displaying multiple indicators per row
- Which android APIs should I use to create battery indicator line on status bar
- JavaFX ProgressBar resize graphic (Possible bug in JavaFX8)
- TreeView Drag or NoDrag Indicators
- nvd3 library: modify default position of LEGEND BOX THAT AUTOMATICALLY POPS UP WHEN YOU POSITION THE MOUSE IN THE CHART
- MQL4 Indicator passing signal to EA
- Keep ios6 disclosure indicator apparence in ios7
- Animate(slide-in/slide-out) the home indicator(mini-hamburger) icon
- Conversion of MetaTrader4 to NinjaTrader
- How can I detect firebase observe childAdded is stop calling when reach queryLimit?
- How to change the label of a MenuItem in a PyGTK application?
- How Do I change the indicator of a tabhost dynmaicly from an other activity
- Pine Editor combining two tradingview indicator scaling problem
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I think you couldn't do this in directly. Instead try to store the configuration of you tab host somewhere. So when you came pack you tab activity and hit the onResume() method you can react on the changed tab configuration and rearrange the tabs.
The location where you store the tab configuration depends on whether the configuration should survive the restart of the whole application. When you don't care that the application is restarted with the standard configuration you could use a Application class to store this information. If the tab changed configuration should also be available after an restart, you will have to persist it somehow on the device. You can read about the different options you got on the Android developer page.