Code example for ToneGenerator

Methods: startTone

0
        if(vib != null){
          vib.vibrate(50);
        } 
      }else{ 
        am.setRingerMode(AudioManager.RINGER_MODE_NORMAL);
        ToneGenerator tg = new ToneGenerator(AudioManager.STREAM_NOTIFICATION, (int)(ToneGenerator.MAX_VOLUME * 0.85));
        if(tg != null){
          tg.startTone(ToneGenerator.TONE_PROP_BEEP);
        } 
      } 
    } 
    finish();
  } 
} 
Connect your IDE to all the code out there  Get Codota for Java