Why do the Android docs say intent extras need package prefix

Intents can be passed on to other apps and the system it self, so courtesy is to use a package namespace.


I believe the Android docs recommend using fully-qualified extras is to handle an uncommon edge case. The edge case is when you are:

  • Writing an Activity that can be started using a public Intent action such as Intent.ACTION_VIEW

AND

  • For your own usage you want to be able to pass custom extras to the Activity described above without interfering with another Activity that is doing the exact same thing and might have extras with the same name but different meanings or format

Phew, it all sounds very unlikely. If you aren't handling public Intent actions then it still seems as though there is no need to fully-qualify your extras, but I guess it doesn't hurt to do it all the time if you are the paranoid type.