OSDN Git Service

Hide the share button if the shared URI is not "content:".
authorOwen Lin <owenlin@google.com>
Tue, 15 May 2012 23:56:59 +0000 (16:56 -0700)
committerOwen Lin <owenlin@google.com>
Wed, 16 May 2012 17:04:50 +0000 (10:04 -0700)
bug:6494818
Change-Id: I70a2997c07c19433cadee34fa348d27445bf2647

src/com/android/gallery3d/app/MovieActivity.java

index 95e3451..629894a 100644 (file)
@@ -19,6 +19,7 @@ package com.android.gallery3d.app;
 import android.app.ActionBar;
 import android.app.Activity;
 import android.content.AsyncQueryHandler;
+import android.content.ContentResolver;
 import android.content.Intent;
 import android.content.pm.ActivityInfo;
 import android.database.Cursor;
@@ -142,7 +143,10 @@ public class MovieActivity extends Activity {
         getMenuInflater().inflate(R.menu.movie, menu);
         ShareActionProvider provider = GalleryActionBar.initializeShareActionProvider(menu);
 
-        if (provider != null) {
+        // Document says EXTRA_STREAM should be a content: Uri
+        // So, we only share the video if it's "content:".
+        if (provider != null && ContentResolver.SCHEME_CONTENT
+                .equals(mUri.getScheme())) {
             Intent intent = new Intent(Intent.ACTION_SEND);
             intent.setType("video/*");
             intent.putExtra(Intent.EXTRA_STREAM, mUri);