I am trying to make the edittext single line. The edittext does comes up as single line but on pressing enter it the cursor comes to the second line and I need to stop this. The singleLine attribute is deprecated so I do not want to use that.

<EditText
    android:id="@+id/txtSearch"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="5dp"
    android:drawablePadding="5dp"
    android:lines="1"
    android:maxLines="1"
    android:inputType="none"
    android:scrollHorizontally="true"
    android:paddingLeft="5dp"
    android:textSize="12sp" />

Can someone let me know what am I goind wrong over here ?

Edit
Report