Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Bitmap にはrecycleメソッドがありますが、必要がなくなった場合は明示的に呼び出す必要がありますか?
recycle
たとえば、ImageView現在ビットマップがあります。ユーザーがボタンをクリックすると、新しいビットマップが ImageView に設定されます。
ImageView
新しいビットマップを割り当てる前に、元のビットマップをリサイクルする必要がありますか?
Androidはい、古いデバイスをターゲットにしている場合は持っています3.0。それはあなたが中傷するのを避けるでしょうOutOfMemoryException.
Android
3.0
OutOfMemoryException
注:android 3ビットマップ メモリがネイティブ ヒープに割り当てられる前。Java オブジェクトは、GC の観点から低いメモリを保持します。
android 3