I want to allow use to enter just 5 lines, I tried this
<EditText
android:layout_below="@+id/tv_signup_descriptionError"
android:id="@+id/et_signup_description"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:hint="@string/et_hint_enterDescription"
android:singleLine="false"
android:lines="5"
android:gravity="top"
android:scrollHorizontally="false"
android:inputType="textMultiLine"
android:maxLines="5"/>
but still I can press Enter after the fifth line
You cannot do that using any XML attributes.
maxlinesrepresents themaximum heightof the EditText and not the number of input lines.You can however implement your own code to check for the number of lines.
The following is not my own code, but is taken from this answer.