0

How to find the end of webpage using WebView ?

Following is my code :

webView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setDomStorageEnabled(true);
webView.setOnTouchListener(new View.OnTouchListener() {
    @Override
    public boolean onTouch(View v, MotionEvent event) {
        webscroallposition = webView.getScrollY();

        return false;
    }
});
Komal12
  • 3,340
  • 4
  • 16
  • 25
Shures
  • 25
  • 1
  • 7

1 Answers1

0

A bit late, but what about this? (Available for APIs < 23)

webView.setOnTouchListener { _, _ ->
    if (webView.canScrollVertically(MotionEvent.ACTION_UP)) {
        // If the screen can scroll down
    } else {
        // If it can't
    }
    false
}
Jaco
  • 923
  • 2
  • 14
  • 28