Re: [android-developers] How to use the "new" clipboard function?
On Tue, Mar 29, 2011 at 5:10 PM, Dominik Erbsland <derbsland@gmail.com> wrote:
> I use the clipboard function to let the user copy some text out of my
> app into the clipboard. but now it says that the way I use the
> clipboard is deprecated.
>
> Unfortunately I could not find an example how I have to use the
> clipboard the "new" way.
> I found the docs here:
> http://developer.android.com/guide/topics/clipboard/copy-paste.html
>
> but I already use the code:
> ClipboardManager clipboard = (ClipboardManager)
> getSystemService(Context.CLIPBOARD_SERVICE);
>
> and Eclipse tells me that this is deprecated.
getSystemService() is not deprecated, and neither is
CLIPBOARD_SERVICE, at least according to the docs.
> Also the "NotePad" example app is deprecated on
> http://developer.android.com/resources/samples/NotePad/index.html
How can an example app be deprecated?
> Could anyone please post me a short example how to add a String to the
> clipboard the "new" way?
The same as the old way:
https://github.com/commonsguy/cw-advandroid/tree/master/SystemServices/ClipIP
If you want to clip rich stuff, you can do that too:
https://github.com/commonsguy/cw-advandroid/tree/master/SystemServices/ClipMusic
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy
Android Training in London: http://bit.ly/smand1, http://bit.ly/smand2
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home