title: Android scrollview scrolls to edittext
body: <p>I have a horizontal <code>ScrollView</code> which has <code>EditText</code>s on the most left, some other stuff in the middle, and on the right most I have a <code>Button</code>. When this button is clicked, a dialog appears. This dialog contains <code>EditText</code>. So when I open this dialog the edittext inside gains focus and the keyboard is shown. That's OK. But what is not OK is that the scroll view is scrolled to the edittext and that edit text gains focus.</p>
  
  <p>So before I click the button the scroolview is scrolled all the way to the right and the focus is at the root <code>RelativeLayout</code> that contains the scrollview. That means no edittext has focus. But when I enter text in the dialog's edittext and press OK, the dialog is closed and now the scrollview is scrolled back all the way to the left and the edittext is focused.</p>
  
  <p>How to prevent this to happen. I want the focus to stay on the <code>RelativeLayout</code> after the dialog is closed. I have set this on the <code>RelativeLayout</code> but it's the same:</p>
  
  <pre><code>android:descendantFocusability="beforeDescendants"
  android:focusableInTouchMode="true"
  </code></pre>