I want to get the function that only refreshes one cell of GridView Currently I am using baseAdapter.notifyDataSetChanged() which refreshes whole grid , and I have to do this even I have only cell having different data How can I do it
We can't refresh single cell, but to achieve this effect we can get position of first cell displayed in the screen (not the first cell of the grid), then simply save that position ,refresh whole grid and preview from that saved position
int prevcurr = gridview.getFirstVisiblePosition();
Adap.notifyDataSetChanged();
try {
Thread.sleep(1);
} catch (InterruptedException e) {
e.printStackTrace();
}
gridview.requestFocusFromTouch();
gridview.setSelection(prevcurr);
Before apply your changment in the cell. After use this code (for me is about the gridview)
adapterForImage.notifyDataSetChanged();
gridview.setAdapter(adapterForImage);
It is a class for to adapt (in my case) a layout N times in the gridview - Boris Karloff 2013-06-24 00:57
getView
method directly - dldnh 2012-04-05 15:54