Code example for WebView

Methods: setPictureListener

0
	public ResumePositionWebViewClient(float scrollRatio, WebView webView, View loadingView, Context context) {
		this.scrollRatio = scrollRatio;
		this.webView = webView;
		this.loadingView = loadingView;
		this.context = context;
		webView.setPictureListener(this);
		state = State.LOADING;
	} 
 
	@Override 
	public void onLoadResource(WebView view, String url) {
		if(state == state.LOADING) {
			Log.i(TAG, "showing loading view...");
			loadingView.setVisibility(View.VISIBLE);
		} 
	} 
 
	@Override 
	public boolean shouldOverrideUrlLoading(WebView view, String url) {
		Log.i(TAG, "overriding URL loading");
		context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));