I am using this to work with Shake, and that works fine for me, but i wanna launch application when user shake their device, see my code below:
@Override
You need to write the code to launch the application to foreground from background while the shake started. This link will help you to do so.