我使用以下代码捕获屏幕,然后将其存储在 sdcard 中并转到另一个活动。但是当我导航到另一个活动时非常慢。我该如何解决?请问有人可以帮我吗?
View v1 = view.getRootView();
v1.setDrawingCacheEnabled(true);
bitmapBcfhForm3 = v1.getDrawingCache();
File imagesFolder = new File( Environment.getExternalStorageDirectory(), "Signatures");
imagesFolder.mkdirs();
String fileName = "bitmapBcfhForm3"+AppointmentDetails.getPatientId+".png";
File out = new File(imagesFolder,fileName);
FileOutputStream mFileOutStream1 = new FileOutputStream(out);
bitmapBcfhForm3.compress(Bitmap.CompressFormat.PNG, 90, mFileOutStream1);
mFileOutStream1.flush();
mFileOutStream1.close();
}
catch (Exception e) {
// TODO: handle exception
Log.v("log_tag", e.toString());
}
startActivity(new intent(A.this.B.classs));