Using this in layout worked : android:descendantFocusability=”beforeDescendants”
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerview"
android:descendantFocusability="beforeDescendants"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/extrasLayout"
android:layout_below="@+id/anchorView"
android:layout_marginTop="@dimen/margin5"
android:fastScrollEnabled="false"
/>
Manifest file : Add this to the activity sectionandroid:windowSoftInputMode=”stateHidden|adjustPan”
<activity
android:name=".activites.CartActivity"
android:label="@string/title_activity_cart"
android:exported="true"
android:windowSoftInputMode="stateHidden|adjustPan"
android:parentActivityName=".activites.HomeActivity"
android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activites.HomeActivity"/>
</activity>