Code example for Resources

Methods: getDrawablegetString

0
        public final CharSequence text;
        public final Drawable image;
        public final int actionTag;
 
        public ListItem(Resources res, int textResourceId, int imageResourceId, int actionTag) {
            text = res.getString(textResourceId);
            if (imageResourceId != -1) {
                image = res.getDrawable(imageResourceId);
            } else { 
                image = null;
            } 
            this.actionTag = actionTag;
        } 
    } 
     
    public AddAdapter(Launcher launcher) {
        super(); 
 
        mInflater = (LayoutInflater) launcher.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
 
        // Create default actions