문제

I want to develop an android app which on shake changes the phone state from sound mode to vibration mode to silent mode. I am not getting the way to read the phone's state. how to do it??

도움이 되었습니까?

해결책

Maybe an hint here : AudioManager

To get mode :

 myAudioManager.getRingerMode();

and then (to change mode )

myAudioManager.setRingerMode(AudioManager.RINGER_MODE_VIBRATE);

Mode list here

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top