I have a dialog activity which includes a multiline text field and two buttons.
The problem is when the length of the sentence in the multiline text field exceeds the width of the space available and breaks to the next line or when I press enter to go to the next line:
it changes the position of the buttons under it!
This is how it should look like:

But after adding some new lines it looks like this:

See the position of the two buttons and the space created under them.
How can I fix this?
Here is the XML code I'm using:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<EditText
android:id="@+id/noteText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:gravity="right"
android:hint="متن خود را تایپ کنید"
android:inputType="textMultiLine"
android:padding="5dp" >
<requestFocus />
</EditText>
<LinearLayout
style="?android:attr/buttonBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="100" >
<Button
android:id="@+id/note_clear"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="50"
android:text="حذف" />
<Button
android:id="@+id/note_save"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="50"
android:text="ذخیره" />
</LinearLayout>
40dpin place ofwrap_content