title: Simultaneous Scroll With 2 different Webviews in Android
body: <p>I'm having a hard time getting the Webviews to scroll simultaneously. One webview works, but the other one doesn't.  Either one of them will work just not at the same time.  I hope someone might be able to help.  I want to be able to scroll either webview and have it change the other one. </p>
  
  <pre><code>private WebView englishWebView;
  
  private WebView koreanWebView;
   Button windowImageView;
   Button windowImageViewKorean;
  
  int counter = 0;
  int scrollXEnglish;
  int scrollYEnglish;
  int scrollXKorean;
  int scrollYKorean;
  
  @Override
  public boolean onTouchEvent(MotionEvent event) {
      return super.onTouchEvent(event);
  }
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);View decorView = getWindow().getDecorView();
      setContentView(R.layout.activity_main);
      //information for Korean part
      koreanWebView = findViewById(R.id.korean_web_view);
      koreanWebView.setWebViewClient(new WebViewClient());
      koreanWebView.getSettings().setJavaScriptEnabled(true);
      koreanWebView.getSettings().setDomStorageEnabled(true);
      koreanWebView.setOverScrollMode(WebView.OVER_SCROLL_NEVER);
      koreanWebView.loadUrl("https://m.comic.naver.com/webtoon/detail.nhn?titleId=183559&amp;no=1&amp;week=mon");
  
  
  
  
      //information for English window
      englishWebView = findViewById(R.id.english_web_view);
  
      englishWebView.setWebViewClient(new WebViewClient());
      englishWebView.getSettings().setJavaScriptEnabled(true);
      englishWebView.getSettings().setDomStorageEnabled(true);
      englishWebView.setOverScrollMode(WebView.OVER_SCROLL_NEVER);
      englishWebView.loadUrl("https://www.webtoons.com/en/fantasy/tower-of-god/season-1-ep-0/viewer?title_no=95&amp;episode_no=1");
  
  
      englishWebView.getViewTreeObserver().addOnScrollChangedListener(new ViewTreeObserver.OnScrollChangedListener() {
  
          @Override
          public void onScrollChanged() {
  
             scrollXEnglish  = englishWebView.getScrollX(); // for horizontalScrollView
             scrollYEnglish = englishWebView.getScrollY(); // for verticalScrollView
  
                  // DO SOMETHING WITH THE SCROLL COORDINATES
              koreanWebView.scrollTo(scrollXEnglish, scrollYEnglish);
  
          }
      });
      koreanWebView.getViewTreeObserver().addOnScrollChangedListener(new ViewTreeObserver.OnScrollChangedListener() {
  
          @Override
          public void onScrollChanged() {
  
  
               scrollXKorean = koreanWebView.getScrollX();
               scrollYKorean = koreanWebView.getScrollY();
  
  
              // DO SOMETHING WITH THE SCROLL COORDINATES
              englishWebView.scrollTo(scrollXKorean, scrollYKorean);
  
          }
      });
  
  }
  </code></pre>
  
  <p>}</p>