Khotmanish,
, . , , , , . , , , . Google .
, StateListDrawable .
StateListDrawable, :
StateListDrawable _drawStates;
:
_drawStates.add(new int[] {android.R.attr.state_pressed}, _newImage);
, getView() :
v.setBackgroundDrawable(_drawStates);
. OnListItemClick(). , OnListItemClick() , . id invalidate() . . , . . :
@Override protected void onListItemClick(final ListView inList, final View v, final int atPos, final long rowID)
{
ImageView _img = (ImageView)(v.findViewById(R.id.app_package));
_img.setBackgroundColor(myClickedColor);
_img.invalidate();
v.invalidate();
inList.invalidate();
}
, , . Clicked View... ListView. -, . , "stateful" , ( ).
Now a more popular but less flexible approach is to create your StateListDrawable in XML. There are several resources to learn how to do this on the Android developer website.
Hope this helps, FuzzicalLogic
source
share