Shake Device to Launch App

后端 未结 4 1982
孤独总比滥情好
孤独总比滥情好 2021-01-02 20:52

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
           


        
4条回答
  •  鱼传尺愫
    2021-01-02 21:05

    Write a separate app for Shake detection. On detection of shake, fire an intent with the package name of app, you want to launch:

    Intent intent = new Intent ();     
    startActivity (intent);
    

提交回复
热议问题