Hi, I have a WebView. I would like to handle those touch who falls into a specific region of the WebView, for example the Rectangle [0, 0, 50, 200]...
I wrote the following code...
The problem is that I would like to get the coordinate of the right-most rectangle(X, Y, Width, Height) [Width - 50, 0, 50, Height] of my WebView... but whenever I call the getWidth() or getHeight() I always get zero as result.
My WebView is declared in the xml:
Thank you.
I wrote the following code...
Code:
wvFirst.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View view, MotionEvent event) {
Log.i("MyApplication", "Touch at: " + event.getX() + ", " + event.getY());
return false;
}
});
The problem is that I would like to get the coordinate of the right-most rectangle(X, Y, Width, Height) [Width - 50, 0, 50, Height] of my WebView... but whenever I call the getWidth() or getHeight() I always get zero as result.
My WebView is declared in the xml:
HTML:
<WebView android:id="@+id/wvFirst" android:layout_width="fill_parent" android:layout_height="fill_parent">
</WebView>
Thank you.