Android Question Android Clipboard

fransvlaarhoven

Active Member
Licensed User
Hello,

is it possible to get/set the content of the clipboard from as service? (The clipboard library only works with an activity)
 

drgottjr

Well-Known Member
Licensed User
maybe it only works for me, but i can set the contents of the clipboard in main, display its contents (to the log) in a service, set the contents in the service and then retrieve and display the contents back in main. declare an instance of the clipboard in both places (global in main, create in the service).
 
Upvote 0

fransvlaarhoven

Active Member
Licensed User
Thanks for the answer.

it seems that changing owner from activity to process in the XML-file of the library also works:

<name>b4a.util.BClipboard</name>
<shortname>BClipboard</shortname>
<owner>process</owner>


this way one can use the standard library also in a service module
 
Upvote 0
Top