Code example for Resources

Methods: getDrawable

0
 
            @Override 
            protected Drawable doInBackground(Integer... position) {
                DrawableInfo info = getItem(position[0]);
                int itemId = info.resource_id;
                Drawable d = mResources.getDrawable(itemId);
                info.drawable = new WeakReference<Drawable>(d);
                return d;
            } 
 
            @Override 
            public void onPostExecute(Drawable result) {
                if (mImageView.get() != null) {
                    mImageView.get().setImageDrawable(result);
                } 
            } 
        } 
 
        public ImageAdapter(Context c, String pkgName) {
            mContext = c;
            Map<ComponentName, String> resources = IconPackHelper.getIconPackResources(c, pkgName);