Esempio n. 1
0
 /**
  * Retrieve the Drawable for the attribute at <var>index</var>. This gets the resource ID of the
  * selected attribute, and uses {@link Resources#getDrawable Resources.getDrawable} of the owning
  * Resources object to retrieve its Drawable.
  *
  * @param index Index of attribute to retrieve.
  * @return Drawable for the attribute, or null if not defined.
  */
 public Drawable getDrawable(int index) {
   final TypedValue value = mValue;
   if (getValueAt(index * AssetManager.STYLE_NUM_ENTRIES, value)) {
     if (false) {
       System.out.println("******************************************************************");
       System.out.println(
           "Got drawable resource: type="
               + value.type
               + " str="
               + value.string
               + " int=0x"
               + Integer.toHexString(value.data)
               + " cookie="
               + value.assetCookie);
       System.out.println("******************************************************************");
     }
     return mResources.loadDrawable(value, value.resourceId);
   }
   return null;
 }