Code example for HashMap

Methods: keySet, size

0
 
            setBackgroundColor(0xFF000000);
 
            LauncherApplication app = (LauncherApplication)context.getApplicationContext();
            mIcons = app.getIconCache().getAllIcons();
            mComponentNames = new ComponentName[mIcons.size()];
            mComponentNames = mIcons.keySet().toArray(mComponentNames);
        } 
 
        private void reset() { 
            removeAllViews();
 
            final ViewGroup.LayoutParams wrap = new ViewGroup.LayoutParams(
                        ViewGroup.LayoutParams.WRAP_CONTENT,
                        ViewGroup.LayoutParams.WRAP_CONTENT);
 
            if (FIXED_STARS) {
                for(int i=0; i<20; i++) {
                    ImageView fixedStar = new ImageView(getContext(), null);
                    fixedStar.setImageResource(R.drawable.widget_resize_handle_bottom);
                    final float s = randfrange(0.25f, 0.75f);