Android系列只androidGooglemap小应用
2010-08-19 14:32:00 来源:WEB开发网数据存储部分完毕了。接下来是关于切换手机情景的功能
手机的铃音设置
1 AudioManager audio = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE); 2 3 // 铃声和震动 4 protected void ringAndVibrate(AudioManager audio){ 5 audio.setRingerMode(AudioManager.RINGER_MODE_NORMAL); 6 audio.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_ON); 7 audio.setVibrateSetting(AudioManager.VIBRATE_TYPE_NOTIFICATION, AudioManager.VIBRATE_SETTING_ON); 8 } 9 // 铃声10 protected void ring(AudioManager audio){11 audio.setRingerMode(AudioManager.RINGER_MODE_NORMAL);12 audio.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_OFF);13 audio.setVibrateSetting(AudioManager.VIBRATE_TYPE_NOTIFICATION, AudioManager.VIBRATE_SETTING_OFF);14 }15 // 震动16 protected void vibrate(AudioManager audio){17 audio.setRingerMode(AudioManager.RINGER_MODE_VIBRATE);18 audio.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_ON);19 audio.setVibrateSetting(AudioManager.VIBRATE_TYPE_NOTIFICATION, AudioManager.VIBRATE_SETTING_ON);20 }21 // 静音22 protected void silent(AudioManager audio){23 audio.setRingerMode(AudioManager.RINGER_MODE_SILENT);24 audio.setVibrateSetting(AudioManager.VIBRATE_TYPE_RINGER, AudioManager.VIBRATE_SETTING_OFF);25 audio.setVibrateSetting(AudioManager.VIBRATE_TYPE_NOTIFICATION, AudioManager.VIBRATE_SETTING_OFF);26 }27 // 改变声音-----减小28 protected void lowerVoice(AudioManager audio, int voice){29 audio.setRingerMode(AudioManager.ADJUST_LOWER);30 audio.adjustVolume(AudioManager.ADJUST_LOWER, voice);31 }32 // 改变声音-----增加33
Tags:Android 系列 androidGooglemap
编辑录入:coldstar [复制链接] [打 印]更多精彩
赞助商链接