title: why drawable still holds reference of textview on article "Android - Avoiding Memory Leaks"
body: <p>Article: <a href="http://developer.android.com/resources/articles/avoiding-memory-leaks.html" rel="nofollow">http://developer.android.com/resources/articles/avoiding-memory-leaks.html</a>
  metioned that:</p>
  
  <pre><code>private static Drawable sBackground;
  
  @Override
  protected void onCreate(Bundle state) {
    super.onCreate(state);
  
    TextView label = new TextView(this);
    label.setText("Leaks are bad");
  
    if (sBackground == null) {
      sBackground = getDrawable(R.drawable.large_bitmap);
    }
    label.setBackgroundDrawable(sBackground);
  
    setContentView(label);
  }
  </code></pre>
  
  <blockquote>
    <p>When a Drawable is attached to a view, the view is set as a callback
    on the drawable.</p>
  </blockquote>
  
  <p>That's true, drawable will hold that view as callback, </p>
  
  <pre><code>public void setBackgroundDrawable(Drawable d) {
          ......
              d.setCallback(this);
  </code></pre>
  
  <p>But when screen orientation changes, drawable's callback will be reset as the new activity context. I think the previous textView will be detached from the static drawble, so that textview and according activity became recyclable.</p>
  
  <p>So could anyone explain me in details?
  Thanks.</p>