I have a searchview widget in my activity that is not part of a toolbar. In my onCreate method I use searchView.setIconified(false); and that does bring the searchView into focus, but it does not bring up the keyboard unless I click it again. How do I have they keyboard also pop up?
XML:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent">
    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
    </android.support.v7.widget.Toolbar>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="15dp"
        android:background="@color/lighterGrey">
    <android.support.v7.widget.SearchView
        android:id="@+id/search_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:transitionName="@string/search_transition"
        android:background="@drawable/search_shape"/>
    </LinearLayout>
    <android.support.v7.widget.RecyclerView
        android:id="@+id/acronym_recyclerview"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>
</LinearLayout>
java:
searchView = (SearchView) findViewById(R.id.search_view);
searchView.setIconified(false);
searchView.setFocusable(true);
searchView.setIconified(false);
searchView.requestFocusFromTouch();
View view = this.getCurrentFocus();
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
if (imm != null) {
    imm.showSoftInput(view, 0);
}
 
     
    