Androidコンテンツのルートビューのスクリーンショットを含むプロジェクトを取得しました。しかし、誰かが編集テキストをクリックして仮想キーボードを開くと、このキーボード ビューを写真に表示できません。つまり、Android コンテンツのルート ビューには仮想キーボードが含まれていません。どうすれば追加できますか? これが私のスクリーンショットコードです:
Bitmap bitmap;
View v1 = this.findViewById(android.R.id.content).getRootView();
v1.setDrawingCacheEnabled(true);
bitmap = Bitmap.createBitmap(v1.getDrawingCache());
v1.setDrawingCacheEnabled(false);
OutputStream fout = null;
imageFile = new File(filePath);
try {
fout = new FileOutputStream(imageFile);
bitmap.compress(Bitmap.CompressFormat.JPEG, 70, fout);
fout.flush();
fout.close();
}catch (Exception e) {
e.printStackTrace();
}
また、私はAndroidエミュレーターに取り組んでいます。今から回答をよろしくお願いします。