From cfd4375c6446e91d81e64dc72b9f3b9f35ac9cdd Mon Sep 17 00:00:00 2001 From: Pin Ting Date: Wed, 18 Jan 2012 18:15:27 +0800 Subject: Shows video filename passed from other apps. bug:5796182 Change-Id: I8de80b56105737ac38db117804b55a161150dbe9 --- src/com/android/gallery3d/app/MovieActivity.java | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'src/com') 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 -- cgit v1.2.3