I wanted to know if there is any feature in Android where I could select a word from a third party application and send or share that word to my application. I could store that word in my application for further processing.

有帮助吗?

解决方案

Implementing a "share" action is easiest if you are targeting API level 14+ (Android 4.0), as documented here: Adding an Easy Share Action.

If you need to target an earlier API level, the process is a bit more involved, as documented here: Receiving Content from Other Apps.

(Note that while I normally consider link-only answers on Stack Overflow to be a poor choice, the process of implementing "share" actions is somewhat involved and fully documented on the Android developer site. This is a case where simply pointing you at the documentation seems like the most appropriate thing to do.)

其他提示

Here is Android copy/paste desciption: http://developer.android.com/guide/topics/text/copy-paste.html. But I don't think there is way to modify 3rd-party app's context menu to add custom option like share, without changing this app's source code or changing Android platform (to add your own sharing mechanism to context menu).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top