I need to change the text for a range of header cells in the data table.
In order to achieve that, I would need to retrieve and store the view ids assigned to those cells, so they can be used later to identify those cell views.
However, when I try to get an ID for the just inflated cell view, it always returns -1.
Here is my sample code:
@Override
public View getView(final int row, final int column, View converView, ViewGroup parent) {
if (converView == null) {
converView = inflater.inflate(getLayoutResource(row, column), parent, false);
if (row == -1){
int viewId = converView.getId();
setHeaderId(viewId, column+1);
}
}
...
}
The converView.getId() in the code above returns -1, despite the fact that the view id has already been assigned and is viewable during the code debugging. For example, I can see the following during debug:
converView= LinearLayout (id= 830042440680)
Any idea why I am getting -1 (= NO_ID) in the above code ?