I am using following code to load an image from internal memory to tab icons. Images are loaded properly for state_enabled but no change when state_selected. What I am doing wrong? thank you.
ImageView icon = (ImageView) tabIndicator.findViewById(R.id.icon);
File imgFile = new File("data/data/"+PACKAGE_NAME+"/biblioteca/" + imageName);
File imgFileSel = new File("data/data/"+PACKAGE_NAME+"/biblioteca/" + imageName);
Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());
Drawable d = new BitmapDrawable(myBitmap);
Bitmap myBitmapSelected = BitmapFactory.decodeFile(imgFileSel.getAbsolutePath());
Drawable dSel = new BitmapDrawable(myBitmapSelected);
StateListDrawable selector = new StateListDrawable();
selector.addState(new int[]{ android.R.attr.state_enabled }, d);
selector.addState(new int[]{ android.R.attr.state_selected }, dSel);
icon.setImageDrawable(selector);}
xml gives an alert “missing content description”
<ImageView android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:src="@drawable/icon"
/>
state_pressedhelp you…and
ant its just Lint error checking ….Its doesnt make differ,,,