开发者

Android: Proper way to reuse my app's activities?

What's the proper way for other people to reuse my Activities? Should they hard 开发者_高级运维code the intent actions in their app or is it customary to provide them with a jar file enumerating my app's intent actions? Is there a less tightly-coupled way to lookup the intent actions?


First of all, take a look at openintents.org and see if there's any match to what your activity does.

Secondly, documentation is always a good idea.

Having the intent details hardcoded in their applications should work just fine. After all, the intents are part of your public interface and shouldn't change.


Your applications manifest should announce what sorts of things your activity can handle, via intent-filters. Outside users can read the manifest to determine what actions you support, and invoke them via action intents.

See intents and intent filters for more details.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜