Handler mHandler = new Handler() { public void handleMessage(Message msg) { switch (msg.what) { case TAKE_SCREEN_SHOT_MESSAGE: new Thread() { public void run() { final Instrumentation inst = new Instrumentation(); inst.sendKeyDownUpSync(KeyEvent.KEYCODE_SYSRQ); Log.d(TAG, "Screenshot KEYCODE_SYSRQ"); }; } .start(); break; default: break; } } };
怎么截图?哈哈哈可以说超方便了,自己写个按钮,点一下,点击该按钮发送一个msg就可以啦
Message msg = mHandler.obtainMessage(TAKE_SCREEN_SHOT_MESSAGE);
mHandler.sendMessageDelayed(msg,1000);