Back to project page Galaxy-Torch.
The source code is released under:
Copyright (c) 2012 Santoso Wijaya Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Sof...
If you think the Android project Galaxy-Torch listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.swijaya.galaxytorch.util; // w w w . ja v a 2 s. c o m import android.annotation.SuppressLint; import android.content.Context; import com.swijaya.galaxytorch.R; public class ClipboardManagerWrapper { @SuppressLint("NewApi") @SuppressWarnings("deprecation") public static void copyToClipboard(Context context, String text) { int sdk = android.os.Build.VERSION.SDK_INT; if (sdk < android.os.Build.VERSION_CODES.HONEYCOMB) { android.text.ClipboardManager clipboard = (android.text.ClipboardManager) context .getSystemService(context.CLIPBOARD_SERVICE); clipboard.setText(text); } else { android.content.ClipboardManager clipboard = (android.content.ClipboardManager) context .getSystemService(context.CLIPBOARD_SERVICE); android.content.ClipData clip = android.content.ClipData .newPlainText( context.getResources().getString( R.string.label_donate_address), text); clipboard.setPrimaryClip(clip); } } }