public static void shareEpisode(Context context,Episode episode,Uri bitmapUri){
  String channelTitle=episode.getChannelTitle();
  String shareUrl=episode.getUrl() != null ? episode.getUrl() : episode.getRemoteMediaUrl();
  int messageResId=episode.getEpisodeStatus() == EpisodeStatus.IN_PROGRESS ? R.string.share_listening_episode_text : R.string.share_episode_text;
  String shareText=String.format(context.getString(messageResId),episode.getTitle(),channelTitle,shareUrl);
  Intent intent=new Intent(Intent.ACTION_SEND);
  intent.setType("text/plain");
  intent.putExtra(Intent.EXTRA_TEXT,shareText);
  if (bitmapUri != null) {
    intent.putExtra(Intent.EXTRA_STREAM,bitmapUri);
  }
  Intent chooser=Intent.createChooser(intent,context.getString(R.string.share_with));
  if (intent.resolveActivity(context.getPackageManager()) != null) {
    context.startActivity(chooser);
  }
}

public static void shareEpisode ( Context context , Episode episode , Uri bitmapUri ) { String channelTitle = episode . getChannelTitle ( ) ; String shareUrl = episode . getUrl ( ) != null ? episode . getUrl ( ) : episode . getRemoteMediaUrl ( ) ; int messageResId = episode . getEpisodeStatus ( ) == EpisodeStatus . IN_PROGRESS ? R . string . share_listening_episode_text : R . string . share_episode_text ; String shareText = String . format ( context . getString ( messageResId ) , episode . getTitle ( ) , channelTitle , shareUrl ) ; Intent intent = new Intent ( Intent . ACTION_SEND ) ; intent . setType ( "text/plain" ) ; intent . putExtra ( Intent . EXTRA_TEXT , shareText ) ; if ( bitmapUri != null ) { intent . putExtra ( Intent . EXTRA_STREAM , bitmapUri ) ; } Intent chooser = Intent . createChooser ( intent , context . getString ( R . string . share_with ) ) ; if ( intent . resolveActivity ( context . getPackageManager ( ) ) != null ) { context . startActivity ( chooser ) ; } }
shares an episode to the android app of choice
