API change - bug 3370353 and bug 3370338
Change-Id: I9da53f3260ca17713e793b420e477686ad23c7d3
This commit is contained in:
@@ -37,7 +37,7 @@ import java.util.List;
|
||||
* This demonstrates the usage of SearchView in an ActionBar as a menu item.
|
||||
* It sets a SearchableInfo on the SearchView for suggestions and submitting queries to.
|
||||
*/
|
||||
public class SearchViewActionBar extends Activity implements SearchView.OnQueryChangeListener,
|
||||
public class SearchViewActionBar extends Activity implements SearchView.OnQueryTextListener,
|
||||
SearchView.OnCloseListener, Button.OnClickListener {
|
||||
|
||||
private SearchView mSearchView;
|
||||
@@ -90,16 +90,16 @@ public class SearchViewActionBar extends Activity implements SearchView.OnQueryC
|
||||
mSearchView.setSearchableInfo(info);
|
||||
}
|
||||
|
||||
mSearchView.setOnQueryChangeListener(this);
|
||||
mSearchView.setOnQueryTextListener(this);
|
||||
mSearchView.setOnCloseListener(this);
|
||||
}
|
||||
|
||||
public boolean onQueryTextChanged(String newText) {
|
||||
public boolean onQueryTextChange(String newText) {
|
||||
mStatusView.setText("Query = " + newText);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean onSubmitQuery(String query) {
|
||||
public boolean onQueryTextSubmit(String query) {
|
||||
mStatusView.setText("Query = " + query + " : submitted");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import android.widget.SearchView;
|
||||
/**
|
||||
* Shows a list that can be filtered in-place with a SearchView in non-iconified mode.
|
||||
*/
|
||||
public class SearchViewFilterMode extends Activity implements SearchView.OnQueryChangeListener {
|
||||
public class SearchViewFilterMode extends Activity implements SearchView.OnQueryTextListener {
|
||||
|
||||
private static final String TAG = "SearchViewFilterMode";
|
||||
|
||||
@@ -58,12 +58,12 @@ public class SearchViewFilterMode extends Activity implements SearchView.OnQuery
|
||||
|
||||
private void setupSearchView() {
|
||||
mSearchView.setIconifiedByDefault(false);
|
||||
mSearchView.setOnQueryChangeListener(this);
|
||||
mSearchView.setOnQueryTextListener(this);
|
||||
mSearchView.setSubmitButtonEnabled(false);
|
||||
mSearchView.setQueryHint(getString(R.string.cheese_hunt_hint));
|
||||
}
|
||||
|
||||
public boolean onQueryTextChanged(String newText) {
|
||||
public boolean onQueryTextChange(String newText) {
|
||||
if (TextUtils.isEmpty(newText)) {
|
||||
mListView.clearTextFilter();
|
||||
} else {
|
||||
@@ -72,7 +72,7 @@ public class SearchViewFilterMode extends Activity implements SearchView.OnQuery
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean onSubmitQuery(String query) {
|
||||
public boolean onQueryTextSubmit(String query) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user