android.text.ClipboardManager
was deprecated since API level 11, and replaced with android.content.ClipboardManager
(source).
How do I write c
Explicitly:
@SuppressWarnings("deprecation")
android.text.ClipboardManager clipboard = (android.text.ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
clipboard.setText(shareViaSMSBody);
Since this has to keep working on older devices, it is likely that the deprecated code will not be removed from Android.