Mutable and Immutable Bitmap in Android

It's about the same difference as with String vs StringBuilder - String is immutable so you can't change its content (well at least not without any hacks), while for StringBuilder you can change its content.
类似于String同StringBuffer的区别,String的内容是不可变的,像str+="anythingelse";这种操作看上去改变了String的内容,实际上是创建了一个新的String(str+“anythingelse”)。而StringBuffer是可以直接改变其内容的。
Set Bitmap mutable or immutable:
BitmapFactory.Options opt = new BitmapFactory.Options();
opt.inMutable = true;//true:Mutable false:Immutable default:Immutable
Bitmap bp = BitmapFactory.decodeResource(getResources(), R.raw.white, opt);

你可能感兴趣的:(Mutable and Immutable Bitmap in Android)