Gestures with WebView
<p>What I'm trying to do:
I want the user to be able to custom gestures and name them "up","down"..etc. Then when the user runs my application, it loads up a WebView with a particular url like <a href="http://google.com" rel="nofollow">http://google.com</a>. Then the user can draw the gesture he created earlier. So if he draws the "up" gesture, then another webview opens.</p>

<p>My problem:
When I try to draw the gesture over the webview, it doesn't draw. Rather it scrolls the webview.</p>

<p>What have I tried:
Already created a GestureOverlayView and put the WebView within that. Unfortunately, the GestureOverlayView is unable to detect the gestures as the WebView gets scrolled.</p>

<p>My Code:</p>

<pre><code>public class WebViewCenter extends Activity implements OnGesturePerformedListener {
/** Called when the activity is first created. */

GestureLibrary mLibrary;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    //WebView webview = (WebView)findViewById(R.id.WebView01);
    //webview.loadUrl("http://www.google.com");
    //Button btnStart = (Button)findViewById(R.id.Start);
    //btnStart.setOnClickListener(this);
    mLibrary = GestureLibraries.fromRawResource(this, R.raw.gestures);
    GestureOverlayView gestures = (GestureOverlayView) findViewById(R.id.gestures_overlay);
    gestures.addOnGesturePerformedListener(this);


    WebView webview = (WebView)findViewById(R.id.WebView);
    webview.getSettings().setJavaScriptEnabled(true);
    webview.loadUrl("http://live.com");


}

public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) {
    mLibrary.load();
    ArrayList&lt;Prediction&gt; predictions = mLibrary.recognize(gesture);
    Log.i("Default Marker", predictions.get(0).toString());
    if (predictions.size() &gt; 0) {
        String action = predictions.get(0).name;

        Log.i("Gesture", action);
        if ("up".equals(action)) {
            Log.i("Up_gesture", "Up gesture detected");
            Intent int_up = new Intent(WebViewCenter.this, WebViewUp.class);
            WebViewCenter.this.startActivity(int_up);
            //return true;
            //Toast.makeText(this, "Adding a contact", Toast.LENGTH_SHORT).show();
        } 
        /*else
        {
            Log.i("Marker 2", "god knows what ur upto");

        }*/
    }
}
</code></pre>

<p>Any advice as to how can I separate the WebView scrolling from the gesture building?</p>

<p>Thanks,
Pawan</p>
