SearchView Edittext not showing cursor
<p>I am unable to show cursor on the edittext of searchview following is the code i am trying to implement but of no use</p>

<pre><code>    searchView = (SearchView) menu.findItem(R.id.search).getActionView();
    final int textViewID = searchView.getContext().getResources().getIdentifier("android:id/search_src_text", null, null);
    final EditText searchTextView = (EditText) searchView.findViewById(textViewID);
    try {
        Field mCursorDrawableRes = TextView.class.getDeclaredField("mCursorDrawableRes");
        mCursorDrawableRes.setAccessible(true);
        mCursorDrawableRes.set(searchTextView, null); //This sets the cursor resource ID to 0 or @null which will make it visible on white background
    } catch (Exception e) {
    }
</code></pre>

<p>I even tried the code below but even this doesnt seem to work.</p>

<pre><code>EditText searchTextView = (EditText) searchView.findViewById(android.support.v7.appcompat.R.id.search_src_text);
searchTextView.setFocusable(true);
searchTextView.setCursorVisible(true);
</code></pre>