title: what is the use of recycle() method in TypedArray
body: <p>I have created a <code>GalleryView</code> and <code>ImageView</code> which displays the Image bigger when an item is clicked in the gallery. I have used the below code to implement the <code>ImageAdapter</code>:</p>
  
  <pre><code>public ImageAdapter(Context c)
  {
      context = c;
      TypedArray a = obtainStyledAttributes(R.styleable.gallery1);
      itemBackground = a.getResourceId(R.styleable.gallery1_android_galleryItemBackground, 0);    
      a.recycle();    
  }
  </code></pre>
  
  <p>When I removed the statement <code>a.recycle()</code> there is no change and the app is running normally as before, but everywhere I read that it is compulsory to recycle the <code>typedArray</code>. When there is no change in the way my app is running what is the use of the <code>recycle()</code> method?</p>