Android震動效果實現如下:
- if(Settings.System.getInt(getContentResolver(), Settings.System.LOCKSCREEN_SOUNDS_ENABLED, 1) != 0)
- {
- Vibrator vibrator = (Vibrator) getSystemService("vibrator");
- vibrator.vibrate(50);
- }
飛行模式判定:
- /**
- * judge current airplane mode is set on
- *
- * @return
- */
- private boolean isAirplanemodeOn()
- {
- return Settings.System.getInt(getContentResolver(), Settings.System.AIRPLANE_MODE_ON, 0) != 0;
- }
更多Android相關信息見Android 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=11