In View.java,
setId - "Sets the identifier for this view. The identifier does not have to be unique in this view's hierarchy. The identifier should be a positive number."
&
findViewById - "Look for a child view with the given id. If this view has the given id,
Why I could not use a negative number as the id of the view? I commented out the
public final View findViewById(int id) { // The original android check at here // if (id < 0) { // is commented out to test if system could run when Ids are negative numbers if (id == NO_ID) { return null; } return findViewTraversal(id); }
The system seems to be working fine.