force conversion to byte array before inflating to avoid ClassCastException.