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):

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

//webview
webview2 = new WebView(this);
setContentView(webview2);
webview2.loadUrl("http://m.pegedo.nl/apotheker.html");

return true;


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