Confused about extra constants


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?


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.