java如何在安卓的图像视图中显示pdf?
下面的代码是从设备中拾取图像。如何从设备中选择pdf。以及如何在图像视图中显示pdf
bt_gall .setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent();
// Show only images, no videos or anything else
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
// Always show the chooser (if there are multiple options available)
startActivityForResult(Intent.createChooser(intent, "Select Picture"), PICK_IMAGE_REQUEST);
alertDialog.dismiss();
}
});
# 1 楼答案
要选择pdf,请尝试以下操作
要将Pdf设置为图像,您需要创建Pdf的缩略图
要创建缩略图,请选中此复选框
https://stackoverflow.com/a/38829523/3416642
希望这对你有帮助