Code example for Instrumentation

Methods: runOnMainSync

0
	 */ 
	 
	public boolean scrollWebView(final WebView webView, int direction, final boolean allTheWay){
 
		if (direction == DOWN) { 
			inst.runOnMainSync(new Runnable(){ 
				public void run(){ 
					canScroll =  webView.pageDown(allTheWay); 
				} 
			}); 
		} 
		if(direction == UP){ 
			inst.runOnMainSync(new Runnable(){ 
				public void run(){ 
					canScroll =  webView.pageUp(allTheWay);
				} 
			}); 
		} 
		return canScroll; 
	}