FileOutputStreamfile =new FileOutputStream("/mnt/sdcard/" +"视频监控"+date +".jpg");
file.write(picBuf,0,stSize.value);
file.close();
ToastUtils.showShort("截图已保存到手机");
final FilenewFile =new File("/mnt/sdcard/" +"视频监控"+date +".jpg");
Intentintent =new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
Uriuri = Uri.fromFile(newFile);
intent.setData(uri);
context.sendBroadcast(intent);//通知系统相册 更新
selfDialog =new SelfDialog(PlayVideoMonitorActivity.this);
selfDialog.setTitle("提示");
selfDialog.setMessage("是否查看截图");
selfDialog.setNoOnclickListener("否",new SelfDialog.onNoOnclickListener() {
@Override
public void onNoClick() {
selfDialog.dismiss();
}
});
selfDialog.setYesOnclickListener("是",new SelfDialog.onYesOnclickListener() {
@Override
public void onYesClick() {
selfDialog.dismiss();
Intentintent1 =new Intent(Intent.ACTION_VIEW);
intent1.setDataAndType(Uri.fromFile(newFile),"image/*");
startActivity(intent1);
}
});
selfDialog.show();