1
bitmap.getByteCount();
得到的是kb
得到的是bytebitmap.getRowBytes() * bitmap.getHeight();
getByteCount() is just a convenience method which does exactly what you have placed in the else-block. In other words, if you simply rewrite getSizeInBytes to always return "bitmap.getRowBytes() * bitmap.getHeight()" you don't need the Android version check.
翻译过来就是:getByteCount()受android版本限制,而getRowBytes() * bitmap.getHeight()则不受android版本限制。