title: Nested scrollview automatically scrolls to bottom
body: <p>I have a GridView within a NestedScrollView. I have used the code below to resize the GridView whenever the content of the GridView is changed. This works fine, however the NestedScrollView scrolls to the very bottom when I swipe from fragment 3 of the app back to fragment 2 (where the NestedScrollView resides). This doesn't happen when swiping from fragment 1 to fragment 2, oddly. It also doesn't happen directly after resizing the GridView. </p>
  
  <p>How can I repress the NestedScrollView from scrolling to the bottom?</p>
  
  <pre><code>private static void resizeGridView(GridView gridView, int items, int columns) {
      ViewGroup.LayoutParams params = gridView.getLayoutParams();
      params.height = singleGridHeight * items;
      gridView.setLayoutParams(params);
      gridView.requestLayout();
  }
  </code></pre>
  
  <p>The following system methods are called when swiping between fragments:
  <a href="https://i.stack.imgur.com/aXuwQ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/aXuwQ.png" alt="enter image description here"></a></p>