Search code examples
androidtabsfragment-tab-host

How to clear the autocompleteTextView string when change the tabhost fragment one to another in android


I am new in android development,I am not able to clear the data when change the tab fragment in android.


Solution

  • You can set setOnTabChangedListener on tabHost. Then override it's methods. Now clear your all data in onTabChanged(String tabId) method. You can identify tab from this method String parameter. Then handle your data according to tab.