I have a simple question.
Let’s say I have a drawable image.
If I use it in two different views:
<LinearLayout
android:id="@+id/layout_a"
android:layout_height="wrap_content"
android:layout_with="wrap_content"
android:background="@drawable/some_drawable" >
<LinearLayout
android:id="@+id/layout_b"
android:layout_height="wrap_content"
android:layout_with="wrap_content"
android:background="@drawable/some_drawable" >
</LinearLayout>
Will it allocate memory twice? or only once for both of them?
thanks in advance!
I think Android makes two different drawable objects from the resource, but keeps only one ‘source’ of the data.
Explains more here:
http://developer.android.com/resources/articles/drawable-mutations.html