안녕하세요.
우선 자신의 화면을 캡쳐를 해서 이미지로 저장하는 것을 찾아서 적용을 했는데요.
근데 다른 부분들을 이상없이 잘 나오는데 이상하게도 구글지도가 프레그먼트로 출력을 하는데 이 지도 부분만 검은색으로 아무 것도 찍히지가 않습니다. 혹시 왜그러는지 원인을 알 수 있을까요?
===============================
/* */
Button check_button = (Button)findViewById(R.id.check_button);
check_button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Bitmap bitmap = takeScreenshot();
saveBitmap(bitmap);
}
});
/* */
public Bitmap takeScreenshot() {
View rootView = findViewById(android.R.id.content).getRootView();
rootView.setDrawingCacheEnabled(true);
return rootView.getDrawingCache(); }
/* */
public void saveBitmap(Bitmap bitmap) {
File imagePath = new File(Environment.getExternalStorageDirectory() + "/screenshot.jpeg");
FileOutputStream fos;
try {
fos = new FileOutputStream(imagePath);
bitmap.compress(CompressFormat.JPEG, 100, fos);
fos.flush();
fos.close();
} catch (FileNotFoundException e) {
Log.e("GREC", e.getMessage());
} catch (IOException e) {
Log.e("GREC", e.getMessage());
}
}