detect Shake in android

后端 未结 3 1680
孤城傲影
孤城傲影 2021-01-14 08:43

I am trying to hit an API when user shake a device 10 times. I have tried many git sample and stack overflow solution but non of them did solve my problem. Some of them dete

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-14 09:26

    By Using SensorListener

    Please check this ticked answer...

    You have to adjust SHAKE_THRESHOLD value to achieve this

    How to detect shake event with android?

    Thank you!

提交回复
热议问题