Ok i found a solution. Tabhosts get "current" whatever methods didn't work for me, so i did a workaround.
I fill bundle with data, send it back to the current tab and then "redraw"/reload current tab.
My code:
srchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
for(String i:testquery)
{
if(i.contains(query))
{
//fill Bundle searchResults
searchResults.putString("rezultat", i);
//reload tabs
mTabHost.invalidate();
//i am switching my tabs, this refreshes UI
mTabHost.setCurrentTab(0);
mTabHost.setCurrentTab(1);
}
}
return false;
}
});
Fragment code where i update elements
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.activity_search_tab, container, false);
Bundle searchResults=getArguments();
if(searchResults!=null)
{
TextView textView=(TextView)v.findViewById(R.id.textViewTestSearch);
textView.setText(searchResults.getString("rezultat"));
}
return v;
}