Use ContextCompat.getSystemService() and the Context.getSystemService() extension function.
This commit is contained in:
parent
cdb6e718f7
commit
3da55d9f40
17 changed files with 61 additions and 43 deletions
|
|
@ -201,7 +201,7 @@ public class Utility {
|
|||
}
|
||||
|
||||
public static void copyToClipboard(Context context, String str) {
|
||||
ClipboardManager cm = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
ClipboardManager cm = ContextCompat.getSystemService(context, ClipboardManager.class);
|
||||
|
||||
if (cm == null) {
|
||||
Toast.makeText(context, R.string.permission_denied, Toast.LENGTH_LONG).show();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue