I have the image's path and I'd like to caLL the native viewer from android, because the user want's the option of zoom and rotate the image. I have to make it by hard or I can call an native Intent?
Asked
Active
Viewed 237 times
1 Answers
0
To call the native viwer :
Intent i = new Intent(Intent.ACTION_VIEW);
i.setDataAndType(Uri.fromFile(new File(path)), "image/jpg");
PackageManager packageManager = getPackageManager();
List<ResolveInfo> activities = packageManager.queryIntentActivities(i, 0);
boolean isIntentSafe = activities.size() > 0;
// Start an activity if it's safe
if (isIntentSafe) {
startActivity(i);
}

LeandroC
- 131
- 3
- 13