Code example for Resources

Methods: getIdentifierdecodeResource

0
   * (all output) 
   * @return true on success 
   */ 
  private boolean loadResourceTexture(String name, int[] result) {
    /* find the resource */ 
    int resourceId = resources.getIdentifier(name, "drawable", "org.xcsoarte");
    if (resourceId == 0) {
      resourceId = resources.getIdentifier(name, "drawable",
                                           "org.xcsoarte.testing"); 
      if (resourceId == 0)
        return false; 
    } 
 
    /* load the Bitmap from the resource */ 
    BitmapFactory.Options opts = new BitmapFactory.Options();
    opts.inScaled = false;
 
    Bitmap bmp = BitmapFactory.decodeResource(resources, resourceId, opts);
 
    return BitmapUtil.bitmapToOpenGL(bmp, result);
  } 
 
  /**