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 answers
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
- Creating global Class holder
- Flutter + Dart: Editing name of a tab shows up a black screen
- android-pdf-viewer Received status code 401 from server: Unauthorized
- Sdk 34 WRITE_EXTERNAL_STORAGE not working
- ussd reader in Recket Native module
- Incorrect display of LinearGradientBrush in IOS
- The Binary Version Of its metadata is 1.8.0, expected Version is 1.6.0 build error
- I can't make TextInput to auto expand properly in Android
- Creating multiple instances of a class with different initializing values in Flutter
- How to create a lottie animation
- making android analyze with coverity sast tool
- Flutter plugin development android src not opening after opening example
- I initialize my ViewModel in the Activity with several fragments as tabs, but the fragments(tabs) return null for the updated livedata
- Node.js Server + Socket.IO + Android Mobile Applicatoin XHR Polling Error...?
- How I can use the shared preferences class?
Related Questions in DYNAMIC
- VBA dynamic feed multiple files into current one but error of "Run-rime error 7 out of memory" occurs
- SSRS use a dynamic SQL query with parameter
- Go to the Next section in Google Forms after an option is selected using App Script
- Add and remove dynamic component Angular
- Server Side Rendering of Dynamic URL using NUXT 3
- html to PDF with new page detection
- How to absolutely position pin icons to different locations when you zoom in an image using the react-zoom-pan-pinch npm package
- Loading dynamic content for offline downloaded website
- Unable to find chart for react.js
- i want to use a dynamic expression in PIVOT values
- How do I dynamically load a CSS file in a TMS WEB Core Website using Delphi?
- Flutter DropdownButton Dynamic Default Value Error
- How to Pass-in a Collection name and Document Key to an AQL query to update the document
- Adding dynamic choices to ChoiceType form field in Symfony 6
- Pass class type that subclass or implements class; then access static methods & create instances of that type; is it possible in Java, and how?
Related Questions in ANDROID-TABHOST
- LiveData is not updating the list in TabFragment when viewcreated
- Alternative of TabHost
- Scrollable TabWidget or TabLayout
- TabHost is deprecated
- Why does my android app crash on new intent, without any error logs?
- How to do Tab Host like Iphone in android?
- How to update TabHost Indicator in Xamarin Android
- How do I make my layout (which is inside a tab linearlayout, take up the whole screen?
- Xamarin Tabhost - overlapped tab content
- ListView is showing only 1 data while there are 3 records coming in the listview adapter
- App crashes on setContent(new Intent ) in tabhost
- XAMARIN: How to Link [Android] Hardware Back Button to Webkit.WebView?
- How to hide one indicator from Tab Host without hiding fragment
- How can I insert a tab at an arbitrary position instead of the last?
- Android TabHost appears in Front of Fragments
Related Questions in INDICATOR
- Alert when change of color indicator
- How to create MQL5 Keltner Channel programmatically
- How can modify this indicator so that it only shows data for a certain amounts of periods?
- Problem executing a condition in PineScript
- Trouble with Label Plotting in Pine Script: Labels Not Appearing Despite Correct Code Logic
- Both left and right scales in a single indicator
- Push Notification Alert
- How to add delay on pinescript for long and short entries
- Using pine editor v5, how can I draw a vertical line on the last candle of the day on every friday
- Plotly indicator gauge / speedometer displaying imperial and metric units at the same time
- RSI Divergence Indicator - How to plot signals from OsLevel and ObLevel
- Convert tradingview heiken ashi with ema to Mql5
- Tab indicator is not able to be positioned correctly as expected
- Can't draw more than one trendline in custom indicator in ctrader
- Text Cursor Indicator by language direction
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?
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)
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.