Android - NullPointerException on SearchView in Fragment
问题 I am always getting searchView null at below line in my fragment class: SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchItem); here is my fragment class, Please find onCreateOptionsMenu method at bottom: public class FriendsListActivity extends Fragment implements EventListener { ArrayList<Users> friendList = new ArrayList<Users>(); ArrayList<Users> blockedList = new ArrayList<Users>(); ArrayList<Users> famliyList = new ArrayList<Users>(); ArrayList<Users>