I've made an app in which I open a webpage, there are two other webpages I want to show. one after a left fling and one after a right fling.

I don't know how to make the code for this. So far I wrote this (as part of a bigger file):

public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {

webview2 = new WebView(this);

return true;

Can someone help me to write it in the right way?