Im learning how to use the gesture builder to recognize gestures and use them in development.
This is a snippet of my code :
public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture) {
ArrayList<Prediction> predictions = oLib.recognize(gesture);
// We want at least one prediction
final EditText et_Text = (EditText) findViewById(R.id.editText1);
if (predictions.size() > 0) {
Prediction prediction = predictions.get(0);
if (prediction.score > 0.1) { // do the work
//Toast.makeText(this, prediction.name, Toast.LENGTH_SHORT)
//.show();
String s ="o";
if (prediction.name == s) {
et_Text.setText("o");
Toast.makeText(this, "TEST", Toast.LENGTH_SHORT)
.show();
}
}
}
}
I got a gesture called o and the idea is when i make that gesture it will type o in a EditText but i cant figure out why it dosent do just that ?
It recognizes the gesture in the first second if (score >0.1) but not in the one blow.
Any idea why ?