布局就是一个imagview
加依赖
implementation 'com.github.chrisbanes.photoview:library:1.2.4'
implementation 'com.android.support:support-v4:27.1.1'
调三方控件 photoview
参考地址:https://blog.csdn.net/dpl12/article/details/78160993
imageView = findViewById(R.id.imageView2);
Intent intent = getIntent();
String content = intent.getStringExtra("photo");
Glide.with(this).load(content).into(imageView);
imageView.setOnPhotoTapListener(new PhotoViewAttacher.OnPhotoTapListener() {
@Override
public void onPhotoTap(View view, float x, float y) {
ActivityCompat.finishAfterTransition(OtherActivity.this);
}
});