这被包围在 try, catch 中,用于编写部分,但如果它不在 try catch 方法中,则应用程序似乎在模拟器中崩溃。我正在尝试将画布保存为位图,然后将位图保存到存储...
screenshot = Bitmap.createBitmap(screenshot, 0, 0, 0, 0);
Canvas can = new Canvas(screenshot);
int i = 0;
String filename = "EnderShot";
while (new File(filename + i + ".png") != null){
FileOutputStream fos = null;
fos = openFileOutput(filename + i + ".png", Context.MODE_PRIVATE);
fos.write(screenshot.getByteCount());
fos.close();
}
这也节省了它......所以如果有人能解决它?