summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/app/MovieActivity.java
diff options
context:
space:
mode:
authorPin Ting <pinting@google.com>2012-01-18 18:15:27 +0800
committerPin Ting <pinting@google.com>2012-02-02 13:20:02 +0800
commitcfd4375c6446e91d81e64dc72b9f3b9f35ac9cdd (patch)
tree32c1d3870ea9db2bd1e5b969098899b48d5bc8f3 /src/com/android/gallery3d/app/MovieActivity.java
parentc9bb527e3a3a22b294e11cb0352ab7dd4e4376fb (diff)
downloadandroid_packages_apps_Snap-cfd4375c6446e91d81e64dc72b9f3b9f35ac9cdd.tar.gz
android_packages_apps_Snap-cfd4375c6446e91d81e64dc72b9f3b9f35ac9cdd.tar.bz2
android_packages_apps_Snap-cfd4375c6446e91d81e64dc72b9f3b9f35ac9cdd.zip
Shows video filename passed from other apps.
bug:5796182 Change-Id: I8de80b56105737ac38db117804b55a161150dbe9
Diffstat (limited to 'src/com/android/gallery3d/app/MovieActivity.java')
-rw-r--r--src/com/android/gallery3d/app/MovieActivity.java23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/com/android/gallery3d/app/MovieActivity.java b/src/com/android/gallery3d/app/MovieActivity.java
index 099e9f59e..ed85582c0 100644
--- a/src/com/android/gallery3d/app/MovieActivity.java
+++ b/src/com/android/gallery3d/app/MovieActivity.java
@@ -85,26 +85,15 @@ public class MovieActivity extends Activity {
}
private void initializeActionBar(Intent intent) {
+ mUri = intent.getData();
ActionBar actionBar = getActionBar();
actionBar.setDisplayOptions(ActionBar.DISPLAY_HOME_AS_UP,
ActionBar.DISPLAY_HOME_AS_UP);
- String title = intent.getStringExtra(Intent.EXTRA_TITLE);
- mUri = intent.getData();
- if (title == null) {
- Cursor cursor = null;
- try {
- cursor = getContentResolver().query(mUri,
- new String[] {VideoColumns.TITLE}, null, null, null);
- if (cursor != null && cursor.moveToNext()) {
- title = cursor.getString(0);
- }
- } catch (Throwable t) {
- Log.w(TAG, "cannot get title from: " + intent.getDataString(), t);
- } finally {
- if (cursor != null) cursor.close();
- }
- }
- if (title != null) actionBar.setTitle(title);
+
+ // Displays the filename as title, which is passed through intent from other apps.
+ // If other apps don't set this value, just display empty string.
+ final String title = intent.getStringExtra(Intent.EXTRA_TITLE);
+ actionBar.setTitle((title != null) ? title : "");
}
@Override