use of com.android.mms.model.MediaModel in project android-aosp-mms by slvn.
the class MessageUtils method viewSimpleSlideshow.
public static void viewSimpleSlideshow(Context context, SlideshowModel slideshow) {
if (!slideshow.isSimple()) {
throw new IllegalArgumentException("viewSimpleSlideshow() called on a non-simple slideshow");
}
SlideModel slide = slideshow.get(0);
MediaModel mm = null;
if (slide.hasImage()) {
mm = slide.getImage();
} else if (slide.hasVideo()) {
mm = slide.getVideo();
}
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
// So we don't see "surrounding" images in Gallery
intent.putExtra("SingleItemOnly", true);
String contentType;
contentType = mm.getContentType();
intent.setDataAndType(mm.getUri(), contentType);
context.startActivity(intent);
}
Aggregations