Here is the seen I have a SHERLOCK FRAGMENT ACTIVITY
which holds four FRAGMENTS
and a SEARCH VIEW
. There are 4 fragments in which last is FRAGMENT SEARCH RESULTS
My question is how to pass data of search query to FRAGMENT SEARCH RESULTS
from search view and display search result in FRAGMENT SEARCH RESULTS
I implemented this
private void setupSearchView(MenuItem searchItem) {
if (isAlwaysExpanded()) {
mSearchView.setIconifiedByDefault(false);
} else {
searchItem.setShowAsActionFlags(MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW);
}
mSearchView.setOnQueryTextListener(this);
}
public boolean onClose() {
return false;
}
protected boolean isAlwaysExpanded() {
return false;
}
@Override
public boolean onQueryTextSubmit(String query) {
if (query.length() > 0) {
**//WHAT SHOULD I WRITE HERE**
}
return false;
}
@Override
public boolean onQueryTextChange(String newText) {
return false;
}