自分のアクティビティの画面をAndroidでキャプチャしようとしています。私は以下のコードを使用しています:
View root = this.activity.getWindow().getDecorView().getRootView();
Bitmap b = Bitmap.createBitmap(root.getWidth(), root.getHeight(), Config.RGB_565);
Canvas c = new Canvas(b);
root.draw(c);
if (b != null && !b.isRecycled()) {
this.screen = Bitmap.createBitmap(b);
}
画面キーボードがポップアップする場合は、アクティビティのウィンドウの一部しか表示されておらずthis.screen
、残りは空白です。
画面キーボードの下にあるパーツを含むアプリのスクリーンショットを取得する方法はありますか?