我正在尝试将bitmap
值传递给imageView
,以便在video
录制camera
之后将其作为缩略图显示在相机屏幕上。(我是试图建立一个自定义相机)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
createVideoFolder();
mMediaRecorder = new MediaRecorder();
mChronometer = (Chronometer) findViewById(R.id.chronometer);
mTextureView = (TextureView) findViewById(R.id.textureView);
mRecordImageButton = (ImageButton) findViewById(R.id.videoButton);
mRecordImageButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mIsRecording) {
mChronometer.stop();
mChronometer.setVisibility(View.INVISIBLE);
mIsRecording = false;
mRecordImageButton.setImageResource(R.mipmap.start_recording);
//Toast.makeText(getApplicationContext(),"Started",Toast.LENGTH_SHORT).show();
mMediaRecorder.stop();
mMediaRecorder.reset();
Bitmap thumb = ThumbnailUtils.createVideoThumbnail(mVideoFileName , MediaStore.Video.Thumbnails.MINI_KIND);
mImageView = (ImageView) findViewById(R.id.bitmapView); // in this line i am getting null value
mImageView.setImageBitmap(thumb);