title: My app puts the phone volume to maximum
body: <p>My app puts the phone volume to maximum.</p>
  
  <pre><code>package com.sms;
  import android.content.BroadcastReceiver;
  import android.content.Context;
  import android.content.Intent;
  import android.media.AudioManager;
  import android.media.MediaPlayer;
  import android.os.Bundle;
  import android.telephony.SmsMessage;
  import android.text.TextUtils;
  import android.widget.Toast;
  
  public class SMSReceiver extends BroadcastReceiver {
  private static final String number = "15555215556";
  
  @Override
  public void onReceive(Context context, Intent intent) {
      Bundle bundle = intent.getExtras();
      Object[] messages = (Object[]) bundle.get("pdus");
      SmsMessage[] sms = new SmsMessage[messages.length];
  
      for (int i=0; i &lt; messages.length; i++) {
          sms[i] = SmsMessage.createFromPdu((byte[]) messages[i]);
      }
      for (SmsMessage msg : sms) {
  
          if (TextUtils.equals(msg.getOriginatingAddress(), number)) {
              Toast.makeText(context, "" + msg.getMessageBody(), Toast.LENGTH_SHORT).show();
  
              //AudioManager mAudioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
  
              MediaPlayer mPlayer = MediaPlayer.create(context, R.raw.son1);
              mPlayer.setVolume(1.0f, 1.0f);
              mPlayer.start();
              abortBroadcast();
          }
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I get an error at the this.getSystemService asking me to create the getSystemService method.
  Someone can help me.
  thanks.</p>