I've got some problem with sendKeyDownUpSync. I want to use it in my widget to control inbuilt music player. It works almost correctly. Almost because when i call function:
public void previousTruck()
{
final Instrumentation inst = new Instrumentation();
new Thread(new Runnable() {
public void run() {
new Instrumentation().sendKeyDownUpSync(KeyEvent.KEYCODE_MEDIA_PREVIOUS);
}).start();
}
It start changing music from my playlist but lots of time, why? I want to make only one "step" to next song from play list.