@Override
 protected void onResume() {
   super.onResume();
   if (getIntent().getAction() != null && getIntent().getAction().equals(Intent.ACTION_VIEW)) {
     Intent intent = getIntent();
     if (BuildConfig.DEBUG) Log.d(TAG, "Received VIEW intent: " + intent.getData().getPath());
     ExternalMedia media = new ExternalMedia(intent.getData().getPath(), MediaType.VIDEO);
     Intent launchIntent = new Intent(this, PlaybackService.class);
     launchIntent.putExtra(PlaybackService.EXTRA_PLAYABLE, media);
     launchIntent.putExtra(PlaybackService.EXTRA_START_WHEN_PREPARED, true);
     launchIntent.putExtra(PlaybackService.EXTRA_SHOULD_STREAM, false);
     launchIntent.putExtra(PlaybackService.EXTRA_PREPARE_IMMEDIATELY, true);
     startService(launchIntent);
   }
 }