I'm trying to use EditText instead of SearchView in this Code
private void setupSearchView() {
SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
final SearchView searchView = (SearchView) findViewById(R.id.searchView);
SearchableInfo searchableInfo = searchManager.getSearchableInfo(getComponentName());
searchView.setSearchableInfo(searchableInfo);
}
and my layout that I want to use is
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".SearchViewActivity" >
<EditText android:id="@+id/searchViewET"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"/>
<TextView
android:id="@+id/searchViewResult"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/searchView"
android:layout_centerHorizontal="true"
android:text="@string/hello_world" />
</RelativeLayout>
Thats because I'm using low api level (level 8) and SearchView make my App crashed. How to do that? Thanks in Advance.