diff options
author | Barnaby James <bjames@google.com> | 2015-04-20 21:10:17 -0700 |
---|---|---|
committer | Barnaby James <bjames@google.com> | 2015-04-21 07:20:39 -0700 |
commit | 6e042caff2553c8f108936e8b0b6de732fe5407c (patch) | |
tree | bda5a53eb35477f28dba1fea711ac9f5fee40ae4 /src/com/android/settings/utils | |
parent | c3385dc11bacdcc4d8e7d614fd7133bb9e609cdb (diff) | |
download | packages_apps_Settings-6e042caff2553c8f108936e8b0b6de732fe5407c.zip packages_apps_Settings-6e042caff2553c8f108936e8b0b6de732fe5407c.tar.gz packages_apps_Settings-6e042caff2553c8f108936e8b0b6de732fe5407c.tar.bz2 |
Add toast notification to VoiceSettingsActivity.
Change-Id: Ic007b2eda8d082cf27e4aa4edf19b5387edb4b74
Diffstat (limited to 'src/com/android/settings/utils')
-rw-r--r-- | src/com/android/settings/utils/VoiceSettingsActivity.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/com/android/settings/utils/VoiceSettingsActivity.java b/src/com/android/settings/utils/VoiceSettingsActivity.java index 21849a4..2553a54 100644 --- a/src/com/android/settings/utils/VoiceSettingsActivity.java +++ b/src/com/android/settings/utils/VoiceSettingsActivity.java @@ -21,11 +21,13 @@ import com.android.settings.R; import android.app.Activity; import android.app.Fragment; import android.app.VoiceInteractor; +import android.app.VoiceInteractor.AbortVoiceRequest; import android.app.VoiceInteractor.CompleteVoiceRequest; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.TextView; +import android.widget.Toast; import android.util.Log; /** @@ -65,6 +67,10 @@ abstract public class VoiceSettingsActivity extends Activity { * not null, then it will be read to the user. */ protected void notifySuccess(CharSequence prompt) { + if (prompt != null) { + Toast.makeText(this, prompt, Toast.LENGTH_LONG).show(); + } + if (getVoiceInteractor() != null) { getVoiceInteractor().submitRequest(new CompleteVoiceRequest(prompt, null)); } @@ -85,8 +91,14 @@ abstract public class VoiceSettingsActivity extends Activity { /** * Indicates when the setting could not be changed. */ - protected void notifyFailure(String reason) { - getVoiceInteractor().submitRequest(new VoiceInteractor.AbortVoiceRequest(reason, null)); + protected void notifyFailure(CharSequence prompt) { + if (prompt != null) { + Toast.makeText(this, prompt, Toast.LENGTH_LONG).show(); + } + + if (getVoiceInteractor() != null) { + getVoiceInteractor().submitRequest(new AbortVoiceRequest(prompt, null)); + } } protected void showFragment(Fragment fragment, String tag) { |