From 43cba542b76891ae8e1f2431bf91f64f9eb5c944 Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Tue, 6 Nov 2012 17:46:50 +0100 Subject: [PATCH] Clicking on the currently selected file accepts it. --- .../android-tutorial-5/src/com/lamerman/FileDialog.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gst-sdk/tutorials/android-tutorial-5/src/com/lamerman/FileDialog.java b/gst-sdk/tutorials/android-tutorial-5/src/com/lamerman/FileDialog.java index 96ff132563..b7e048ceba 100644 --- a/gst-sdk/tutorials/android-tutorial-5/src/com/lamerman/FileDialog.java +++ b/gst-sdk/tutorials/android-tutorial-5/src/com/lamerman/FileDialog.java @@ -285,6 +285,11 @@ public class FileDialog extends ListActivity { }).show(); } } else { + if (selectedFile != null && selectedFile.getPath().equals(file.getPath())) { + getIntent().putExtra(RESULT_PATH, selectedFile.getPath()); + setResult(RESULT_OK, getIntent()); + finish(); + } selectedFile = file; l.setItemChecked(position, true); selectButton.setEnabled(true);