Example usage for android.media ToneGenerator TONE_PROP_NACK

List of usage examples for android.media ToneGenerator TONE_PROP_NACK

Introduction

In this page you can find the example usage for android.media ToneGenerator TONE_PROP_NACK.

Prototype

int TONE_PROP_NACK

To view the source code for android.media ToneGenerator TONE_PROP_NACK.

Click Source Link

Document

Proprietary tone, negative acknowlegement: 300Hz+400Hz+500Hz, 400ms ON

Usage

From source file:com.commonsware.android.andshooter.ScreenshotService.java

@Override
public int onStartCommand(Intent i, int flags, int startId) {
    if (i.getAction() == null) {
        resultCode = i.getIntExtra(EXTRA_RESULT_CODE, 1337);
        resultData = i.getParcelableExtra(EXTRA_RESULT_INTENT);
        foregroundify();//from w w  w.  ja  va2 s.  c om
    } else if (ACTION_RECORD.equals(i.getAction())) {
        if (resultData != null) {
            startCapture();
        } else {
            Intent ui = new Intent(this, MainActivity.class).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

            startActivity(ui);
        }
    } else if (ACTION_SHUTDOWN.equals(i.getAction())) {
        beeper.startTone(ToneGenerator.TONE_PROP_NACK);
        stopForeground(true);
        stopSelf();
    }

    return (START_NOT_STICKY);
}

From source file:jmri.enginedriver.throttle.java

void GamepadFeedbackSound(boolean invalidAction) {
    if (mainapp.appIsFinishing) {
        return;//from   ww  w .  ja  v  a 2  s  . c o  m
    }

    if (tg != null) {
        if (invalidAction)
            tg.startTone(ToneGenerator.TONE_PROP_NACK);
        else
            tg.startTone(ToneGenerator.TONE_PROP_BEEP);
    }
}