I'm working on an application .. but Audiomanager is not working i can't see any error my application got crash on phone I'm using AudioManager in BroadCastReciver Class when sms recive and text of sms is same of the particular text i've set the volume should be change silent to Normal mode.
if(message.equals(pwd)) {
AudioManager au;
au = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
au.setRingerMode(AudioManager.RINGER_MODE_NORMAL);
// Show Alert
int duration = Toast.LENGTH_LONG;
Toast toast = Toast.makeText(context, "Volumn Changed By Phone Finder App", duration);
toast.show();
}
else {
int duration = Toast.LENGTH_LONG;
Toast toast = Toast.makeText(context, "Doesn't match", duration);
toast.show();
}
See Question&Answers more detail:os