Change:
if (drawable == null) {
drawable = getResources().getDrawable(R.drawable.ic_launcher);
}
To something like:
if (drawable == null)
drawable = getResources().getDrawable(R.drawable.ic_launcher);
else
Log.i("blablabla", "Drawable initialized in prior activity");
And then start doing the screen rotations. You'll notice that Log.i
will kick-in because the drawable is marked as static and is initialized already in prior activity. This is the point where memory leaks start to begin.
Since modern devices are pretty much hefty with memory resources thus you do not notice such leaks so easily. However, if your application contains a lot of such references or running over a low-end device then you may get lucky to head memory-leaks soon enough.