title: Scrollview autoscrolls after changing visibility of Ad
body: <p>I have a <code>ScrollView</code> that contains <code>Textview</code>, <code>Imageview</code>, <code>Webview</code> and a sticky <code>PublisherAdView</code> at the bottom of a <code>RelativeLayout</code> that contains my <code>ScrollView</code> and <code>PublisherAdView</code>.</p>
  
  <p>My ad's visibility is <code>GONE</code> as default, but after the ad loads, i change the visibility of <code>PublisherAdView</code> to <code>VISIBLE</code>. </p>
  
  <p>Problem is that when i change the visibility, my <code>ScrollView</code> auto scrolls to some location, and i don't want that.</p>
  
  <p>How can i fix this?</p>
  
  <p>This is my layout</p>
  
  <pre><code>&lt;RelativeLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="fill_parent"
  android:background="@color/windowBackground"&gt;
  
  &lt;LinearLayout
      android:layout_above="@+id/ad_view_sticky"
      android:layout_width="match_parent"
      android:layout_height="fill_parent"
      android:background="@color/windowBackground"
      android:orientation="vertical"&gt;
      &lt;LinearLayout
          android:id="@+id/container_toolbar"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical"&gt;
  
          &lt;include
              android:id="@+id/toolbar"
              layout="@layout/toolbar" /&gt;
      &lt;/LinearLayout&gt;
      &lt;ScrollView
          android:id="@+id/scroller"
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:layout_weight="1"&gt;
  
          &lt;LinearLayout
              android:id="@+id/news_content"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:background="@color/windowBackground"
              android:orientation="vertical" &gt;
  
              &lt;TextView
                  android:id="@+id/title"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:textColor="@color/main_text_color"
                  android:textSize="24sp"
                  android:textStyle="bold"
                  android:layout_marginLeft="10dp"
                  android:layout_marginTop="5dp"
                  android:layout_marginRight="10dp"
                  android:layout_marginBottom="5dp" /&gt;
  
              &lt;TextView
                  android:id="@+id/spot"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:textColor="@color/main_text_color"
                  android:layout_marginBottom="5dp"
                  android:textSize="16sp"
                  android:textStyle="bold"
                  android:layout_marginLeft="10dp"
                  android:layout_marginTop="5dp"
                  android:layout_marginRight="10dp" /&gt;
  
              &lt;RelativeLayout
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:id="@+id/relativeLayout"&gt;
  
  
                  &lt;ProgressBar
                      android:id="@+id/progressBar"
                      style="?android:attr/progressBarStyle"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_gravity="center"
                      android:visibility="visible"
                      android:layout_centerHorizontal="true"
                      android:layout_centerVertical="true"
                      android:layout_marginTop="40dp"
                      android:layout_marginBottom="40dp"/&gt;
  
                  &lt;ImageView
                      android:id="@+id/image"
                      android:layout_width="fill_parent"
                      android:layout_height="wrap_content"
                      android:contentDescription="@string/descr_image"
                      android:src="@drawable/resimsiz"/&gt;
  
  
                  &lt;LinearLayout
                      android:layout_width="fill_parent"
                      android:layout_height="wrap_content"
                      android:orientation="horizontal"
                      android:layout_alignParentBottom="true"
                      android:background="#80000000"&gt;
  
                      &lt;TextView
                          android:id="@+id/category"
                          android:layout_width="0dp"
                          android:layout_height="wrap_content"
                          android:layout_weight="1"
                          android:textColor="@color/secondary_text_color"
                          android:textSize="14sp"
                          android:textStyle="bold"
                          android:layout_marginStart="3dp"
                          android:layout_marginLeft="3dp"
                          android:layout_marginBottom="3dp"
                          android:layout_marginTop="3dp" /&gt;
  
                      &lt;TextView
                          android:id="@+id/date"
                          android:layout_width="0dp"
                          android:layout_height="wrap_content"
                          android:layout_weight="1"
                          android:gravity="end"
                          android:textColor="@color/secondary_text_color"
                          android:textSize="14sp"
                          android:textStyle="bold"
                          android:layout_marginEnd="3dp"
                          android:layout_marginRight="3dp"
                          android:layout_marginBottom="3dp"
                          android:layout_marginTop="3dp" /&gt;
                  &lt;/LinearLayout&gt;
  
              &lt;/RelativeLayout&gt;
  
              &lt;com.google.android.gms.ads.doubleclick.PublisherAdView
                  xmlns:ads="http://schemas.android.com/apk/res-auto"
                  android:id="@+id/ad_view"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  ads:adSize="SMART_BANNER"
                  ads:adUnitId="@string/ad_news_detail_sticky"
                  android:layout_marginTop="10dp"
                  android:layout_marginBottom="5dp"
                  android:visibility="gone"/&gt;
  
              &lt;WebView
                  android:id="@+id/content"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  tools:ignore="WebViewLayout"
                  android:layout_marginLeft="10dp"
                  android:layout_marginRight="10dp"
                  android:layout_marginTop="5dp"/&gt;
              &lt;TextView
                  android:id="@+id/tv_related_contents"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:text="@string/tv_related_contents"
                  android:visibility="gone"
                  android:padding="10dp"
                  android:textSize="16sp" /&gt;
          &lt;/LinearLayout&gt;
      &lt;/ScrollView&gt;
  &lt;/LinearLayout&gt;
  
  &lt;com.google.android.gms.ads.doubleclick.PublisherAdView
      xmlns:ads="http://schemas.android.com/apk/res-auto"
      android:id="@id/ad_view_sticky"
      android:layout_alignParentBottom="true"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      ads:adSize="SMART_BANNER"
      ads:adUnitId="@string/ad_news_detail_sticky"
      android:layout_marginTop="10dp"
      android:layout_marginBottom="5dp"
      android:layout_centerInParent="true"
      android:visibility="gone"/&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>And my code part is</p>
  
  <pre><code>mAdView.setAdListener(new AdListener(){
  PublisherAdView mAdView = (PublisherAdView) findViewById(R.id.ad_view_sticky);
      @Override
      public void onAdLoaded() {
          super.onAdLoaded();
          mAdView.setVisibility(View.VISIBLE);
      }
  });
  </code></pre>