0

In my code there is a webview and I implemented PictureListener for viewing a particular part of the webpage.But i can pass only 2 coordinates to the function so that i can view only from top left corner of the page to a specific coordinate. how can I pass 4 coordinates so that I can view somewhat middle portion of the webpage?.

**MyWebViewActivity.java

package com.example.admin;

import android.os.Bundle;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.graphics.Picture;
import android.view.MotionEvent;
import android.view.View;
import android.webkit.WebView;
import android.webkit.WebView.PictureListener;
import android.webkit.WebViewClient;

@SuppressWarnings("deprecation")
public class MyWebViewActivity extends Activity implements PictureListener{

private WebView webView;

@SuppressLint("SetJavaScriptEnabled")
@SuppressWarnings("deprecation")
@Override
public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.webview);

        webView = (WebView)findViewById(R.id.webView1);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.setWebViewClient(new WebViewClient());
        webView.setPictureListener(this);
        // disable scroll on touch
        webView.setOnTouchListener(new View.OnTouchListener() {



            @Override
            public boolean onTouch(View v, MotionEvent event) {
                // TODO Auto-generated method stub
                return false;
            }

        });
        webView.loadUrl("http://app.samworkshops.org/PasswordProtect.aspx");

    }            

@Override
@Deprecated
public void onNewPicture(WebView view, Picture picture) {
    // TODO Auto-generated method stub
    webView.scrollTo(100,100);
}
}

how can I pass 4 coordinates so that I can view somewhat middle portion of the webpage?

jww
  • 97,681
  • 90
  • 411
  • 885
sadab
  • 59
  • 2
  • 7

0 Answers0