In one app I was making , I needed to highlight a selected item in gridview .
What I though would be a matter of selecting some xml properties , turned out to be quite elaborate.
I was feeling lazy so here is what i did ,
grid.setOnItemClickListener(new AdapterView.OnItemClickListener()
{
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id)
{
Toast.makeText(GridViewActvity.this, "You Clicked at " +web[+ position], Toast.LENGTH_SHORT).show();
grid.requestFocusFromTouch();
grid.setSelection(position);
}
This is workaround though , but might be useful in certain situations.
The full source can be downloaded here







My brother recommended I might like this web site. He was totally right.
This post actually made my day. You cann’t imagine
simply how much time I had spent for this info! Thanks!