Another way is by adding on LinearLayout:
android:focusable="true"
android:focusableInTouchMode="true"
Let me indicate that
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
still does the same thing, but the cursor is still there.