Android: Gestures not Performed Well
<p>I want to use <code>Gesture</code> in my application. So I've checked out this <a href="http://android-developers.blogspot.com/2009/10/gestures-on-android-16.html">documentation</a> and createad a gesture already. Then copied that gesture to my <code>raw</code> folder which is located to <code>res/</code>.</p>

<p>Everything is okay from here, then I impelement <code>OnGesturePerformedListener</code> as shown below:</p>

<pre><code>if(!mLibrary.load()) {
    Log.d("Tag", "Couldn't load");
} else {
    Log.d("Tag", "Loaded");
    GestureOverlayView gesture = (GestureOverlayView) findViewById(R.id.gestures);
    gesture.addOnGesturePerformedListener(this);
}
</code></pre>

<p>And finally here is my listener:</p>

<pre><code>public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) {
    ArrayList&lt;Prediction&gt; predictions = mLibrary.recognize(gesture);
    Log.d("Tag", "Performed");
    // We want at least one prediction
    if (predictions.size() &gt; 0) {
        Prediction prediction = predictions.get(0);
        // We want at least some confidence in the result
        if (prediction.score &gt; 1.0) {
            // Show the spell
            Toast.makeText(this, prediction.name, Toast.LENGTH_SHORT).show();
        }
    }
}
</code></pre>

<p>The problem is when I try to draw gesture nothing changes. Even <code>onGesturePerformed</code> not working. What's problem?</p>

<p>I'm not sure but maybe layout could cause, here it is:</p>

<pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:background="@drawable/splash_bg"
    android:screenOrientation="portrait" &gt;

    &lt;android.gesture.GestureOverlayView
        android:id="@+id/gestures"
        android:layout_width="fill_parent" 
        android:layout_height="0dip"
        android:layout_weight="1.0" /&gt;    

&lt;/RelativeLayout&gt;
</code></pre>

<p>Any help would be great.</p>
