Вы забыли вызвать метод
measure
Исправьте вот так:
public static Bitmap getBitmapFromView(View view, int totalHeight, int totalWidth) {
Bitmap returnedBitmap = Bitmap.createBitmap(totalWidth,totalHeight , Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(returnedBitmap);
Drawable bgDrawable = view.getBackground();
if (bgDrawable != null)
bgDrawable.draw(canvas);
else
canvas.drawColor(Color.WHITE);
view.measure( View.MeasureSpec.makeMeasureSpec(totalWidth,View.MeasureSpec.EXACTLY),
View.MeasureSpec.makeMeasureSpec(totalHeight,View.MeasureSpec.EXACTLY));
view.layout(0,0,totalWidth,totalHeight);
view.draw(canvas);
return returnedBitmap;
}