为什么在活动变得不可见(调用了Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setData(Uri.parse("smb://192.168.200.228"));
intent.putExtra("smb_username", "ABC");
intent.putExtra("smb_password", "xxx");
intent.putExtra("remote_folder", "/yourshare/folder"); //activity start
startActivityForResult(intent, BROWSE_REQUEST);
,onSurfaceTextureDestroyed
的Android 7和8中没有调用onPause
?
要解决“相机预览”尺寸大于或小于onStop
时TextureView
帧填充的问题,我使用TextureView's
TextureView's
但是在活动变得不可见(SurfaceTexture.setDefaultBufferSize(cameraWidth, cameraHeight)
,onPause
)并且没有调用onStop
之后,我尝试回到活动(onSurfaceTextureDestroyed
,onResume
)框架不再适合TextureView的大小,我尝试再次调用onStart
,但它没有任何效果(框架不会充满全视图),直到稍后我调用此方法为止:
SurfaceTexture.setDefaultBufferSize(cameraWidth, cameraHeight)
因此在onPause,onStop期间不会调用public void onStart() {
mTextureView.postDelayed(() -> {
mTextureView.getSurfaceTexture().setDefaultBufferSize(cameraWidth, cameraHeight);
}, 2000);
}
和onSurfaceTextureDestroyed
仅在onCreate,onStart,onResume之后被调用一次,但是在活动重新打开(onPause,onStop,onStart,onResume)之后才被调用,因为纹理没有被破坏。...
onSurfaceTextureAvailable