On some devices, it is not possible to get Bitmap from View via getDrawingCache() . Not at all. On 4.4.4 SGSIII - everything is normal, and on 4.1.2 the GT-S7582 - fails.
Rather, the function itself is executed, but when I try to find out the height or width of the resulting Bitmap , I swear at java.lang.NullPointerException .
ps.Sam View - more than the screen size of the device (in both cases).
RelativeLayout rl_timer_to_send = (RelativeLayout) c.getWindow().findViewById(R.id.rl_timer_to_send); rl_timer_to_send.setVisibility(View.VISIBLE); rl_timer_to_send.setDrawingCacheEnabled(true); Bitmap layer_timer = rl_timer_to_send.getDrawingCache(); float resizeTimerFactor = 851.0f / layer_timer.getWidth(); // java.lang.NullPointerException