summaryrefslogtreecommitdiffstats
path: root/tests/VoiceInteraction/src/com/android/test/voiceinteraction/TestInteractionActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/VoiceInteraction/src/com/android/test/voiceinteraction/TestInteractionActivity.java')
-rw-r--r--tests/VoiceInteraction/src/com/android/test/voiceinteraction/TestInteractionActivity.java22
1 files changed, 12 insertions, 10 deletions
diff --git a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/TestInteractionActivity.java b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/TestInteractionActivity.java
index 016a80e..9c772ff 100644
--- a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/TestInteractionActivity.java
+++ b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/TestInteractionActivity.java
@@ -30,28 +30,30 @@ public class TestInteractionActivity extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- setContentView(R.layout.test_interaction);
if (!isVoiceInteraction()) {
Log.w(TAG, "Not running as a voice interaction!");
finish();
return;
}
+ setContentView(R.layout.test_interaction);
+
mInteractor = getVoiceInteractor();
- mInteractor.startConfirmation(new VoiceInteractor.Callback() {
+ VoiceInteractor.ConfirmationRequest req = new VoiceInteractor.ConfirmationRequest(
+ "This is a confirmation", null) {
@Override
- public void onConfirmationResult(VoiceInteractor.Request request, boolean confirmed,
- Bundle result) {
- Log.i(TAG, "Confirmation result: confirmed=" + confirmed + " result=" + result);
- finish();
+ public void onCancel() {
+ Log.i(TAG, "Canceled!");
+ getActivity().finish();
}
@Override
- public void onCancel(VoiceInteractor.Request request) {
- Log.i(TAG, "Canceled!");
- finish();
+ public void onConfirmationResult(boolean confirmed, Bundle result) {
+ Log.i(TAG, "Confirmation result: confirmed=" + confirmed + " result=" + result);
+ getActivity().finish();
}
- }, "This is a confirmation", null);
+ };
+ mInteractor.submitRequest(req);
}
@Override