blob: e6779ade48eeb6d109784b0d00c8fba28887a7b1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
package cgeo.geocaching.utils;
import cgeo.geocaching.cgeoapplication;
import android.content.Context;
import android.text.ClipboardManager;
/**
* Clipboard Utilities. Functions to copy data to the Android clipboard.
* This class uses the deprecated function ClipboardManager.setText(CharSequence).
* API 11 introduced setPrimaryClip(ClipData)
*/
@SuppressWarnings("deprecation")
public final class ClipboardUtils {
/**
* Places the text passed in onto the clipboard as text
*
* @param text
* The text to place in the clipboard.
*/
public static void copyToClipboard(final CharSequence text) {
final ClipboardManager clipboard = (ClipboardManager) cgeoapplication.getInstance().getSystemService(Context.CLIPBOARD_SERVICE);
clipboard.setText(text);
}
}
|