11

I need to implement trimming operation over a Video.I am using this code, its works perfectly on Gallery2 package installed phones. but its does not return onActivityResult(the intent will not return any results if the triiming was successful).

code:

Intent trimVideoIntent = new Intent("com.android.camera.action.TRIM");

            // The key for the extra has been discovered from com.android.gallery3d.app.PhotoPage.KEY_MEDIA_ITEM_PATH
            trimVideoIntent.putExtra("media-item-path", FilePath);
            trimVideoIntent.setData(videoUri);

            // Check if the device can handle the Intent
            List<ResolveInfo> list = getPackageManager().queryIntentActivities(trimVideoIntent, 0);
            if (null != list && list.size() > 0) {
                startActivityForResult(trimVideoIntent,2); // Fires TrimVideo activity into being active
            }else {
                Toast.makeText(this, "Video trimming not supported", 1).show();
            }

Is there any way to close gallery2 after trimming and return result ?

Community
  • 1
  • 1
Shijil
  • 2,226
  • 18
  • 33

0 Answers0