summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/CameraActivity.java
diff options
context:
space:
mode:
authorlikaid <likaid@codeaurora.org>2015-02-12 10:59:07 +0800
committerLinux Build Service Account <lnxbuild@localhost>2015-02-17 03:11:56 -0700
commit729ec2972cb37463d8a1b98133904ce0e0996668 (patch)
tree114be938eb6c3922634ef5f3a194777db6c562f6 /src/com/android/camera/CameraActivity.java
parent12379846e84e949e5f96fb32ecf5ddd6f28d1a51 (diff)
downloadandroid_packages_apps_Snap-729ec2972cb37463d8a1b98133904ce0e0996668.tar.gz
android_packages_apps_Snap-729ec2972cb37463d8a1b98133904ce0e0996668.tar.bz2
android_packages_apps_Snap-729ec2972cb37463d8a1b98133904ce0e0996668.zip
SnapdragonCamera: Fix play the video directly when goto gallery
When clicked the preview thumbnail of a video, Camera launched Gallery with the action Intent.ACTION_VIEW, it caused Gallery play the video directly after Gallery started. Set the action Intent.ACTION_MAIN when launched Gallery. Change-Id: I74c9fc7b66a8ddb5fd06ceba5a0bd370e97b1154 CRs-Fixed: 794309 (cherry picked from commit 4c0d475c7d3be21487a34491a0072918dbbac230)
Diffstat (limited to 'src/com/android/camera/CameraActivity.java')
-rw-r--r--src/com/android/camera/CameraActivity.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index b3a7680a9..1f13138b9 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -545,8 +545,20 @@ public class CameraActivity extends Activity
return;
}
}
- Intent intent = new Intent(Intent.ACTION_VIEW, uri);
- startActivity(intent);
+ try {
+ Intent intent = IntentHelper.getGalleryIntent(this);
+ intent.setAction(Intent.ACTION_VIEW);
+ intent.setData(uri);
+ startActivity(intent);
+ } catch (ActivityNotFoundException ex) {
+ try {
+ Log.w(TAG, "Gallery not found");
+ Intent intent = new Intent(Intent.ACTION_VIEW, uri);
+ startActivity(intent);
+ } catch (ActivityNotFoundException e) {
+ Log.w(TAG, "No Activity could be found to open image or video");
+ }
+ }
}
/**