SearchView In ListView having a custom Adapter
Try this way,hope this will help you… activity_main.xml <SearchView android:id=”@+id/searchView1″ android:layout_width=”match_parent” android:layout_height=”wrap_content”/> <ListView android:id=”@+id/listView1″ android:layout_width=”match_parent” android:layout_height=”0dp” android:layout_weight=”1″/> </LinearLayout> row.xml <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:orientation=”vertical” android:layout_width=”match_parent” android:layout_height=”match_parent”> <TextView android:id=”@+id/txtName” android:layout_width=”wrap_content” android:layout_height=”wrap_content” /> <TextView android:id=”@+id/txtAge” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_marginTop=”5dp”/> </LinearLayout> MainActivity.java public class MainActivity extends Activity implements SearchView.OnQueryTextListener { private SearchView mSearchView; private ListView mListView; private ArrayList<Employee> … Read more