Java tutorial
//package com.java2s; import android.app.Instrumentation; public class Main { public static void sendKeyDownUpSync(final int keyCode) { new Thread(new Runnable() { @Override public void run() { new Instrumentation().sendKeyDownUpSync(keyCode); } }).start(); } }