Hello all,
I want to generate a presskey when i move my phone.
i try with that but it doesn't work => crash
x = values[SensorManager.DATA_X] * 9;
if (x >=45 ) {
SimulationKey.PressTheKeyRIGHT();
}
// in Simulation class
public static void pressTheKeyRIGHT() {
Instrumentation i = new Instrumentation();
i.sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_LEFT);
}
My program detect the movement and print a message (when i replace
SimulationKey.PressTheKeyRIGHT(); by a message), but crash when call
the function to do a keypress....
Any idea ?
Thx :)
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en