拍摄屏幕截图:View view = findViewById(R.id.id_of_constraintLayout); // Here you assign the view Variable to the id of the View hosting all your Views. view.setDrawingCacheEnabled(true);view.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);Bitmap screenshot = Bitmap.createBitmap(view.getDrawingCache());view.setDrawingCacheEnabled(false);