开发者

Is it necessary to include application package prefix when defining a Custom Action string

Is including a application package prefix while defining a custom action string i开发者_StackOverflow中文版s convention or mandatory?


The documentation for the <action> element in the Manifest says:

For actions you define, it's best to use the package name as a prefix to ensure uniqueness.

So it is only a convention, in that there's no technical requirement to put the package name, but it's convention that will help you. For example, if you created an action with the name REFRESH it's quite possible another app might create an action with exactly the same name which could cause you problems. If you prepend your package to the action name then you can sure your names are unique and only your app will intercept them.

There's an attempt to registry of common actions at openintents.org but it doesn't have that many entries.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜