I have a Gridview where i have many images that I get from url. I have added all of them to an Arraylist and set the Arraylist to Gridview. I have used
grid.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
//my code here
}
so, now when i click on GridView items i get a border around each grid item. can I change the color of border?
Yes you can. In the layout of the grid items you can set the background drawable as a Selector. http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList You can set each state of the item (pressed, focused, default, etc.) to correspond to any color (or drawable) you want. It would be easiest for you to make the border as a custom drawable. Either a Shape or a 9-patch.