Confused about extra constants


#1

Hi there. I am slightly confused about the point in having extra constants to pass as arguments to a few methods (i.e., the putExtra method). Wouldn’t this method achieve the same results without the need for those constants? Is there a specific reason we name them according to the package?


#2

In an intent, your extras might be sitting there with extra values set by other code. Namespacing constans prevents your constants for accidentally colliding with values that may be set by that other code.