Android screenshot from code. Got it but not perfect

前端 未结 6 562
攒了一身酷
攒了一身酷 2021-02-04 21:47

I\'m trying to take a screenshot in code in Android. Actually the screenshot is the bitmap of the main RelativeLayout. The screenshot is taken but the content appears wrong, the

6条回答
  •  无人共我
    2021-02-04 22:30

    LinearLayout ll = (LinearLayout )findViewById(R.id.layout); ll .setDrawingCacheEnabled(true); Bitmap bm = v1.getDrawingCache();

    Try this

提交回复
热议问题