Clean up ClipboardManager
This commit is contained in:
parent
f82beb4287
commit
15b6a91914
1 changed files with 4 additions and 10 deletions
|
@ -14,16 +14,10 @@ public class ClipboardManager {
|
|||
}
|
||||
|
||||
|
||||
protected Context mContext;
|
||||
private Context context;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param context
|
||||
* A {@link Context} instance.
|
||||
*/
|
||||
protected ClipboardManager(Context context) {
|
||||
mContext = context;
|
||||
private ClipboardManager(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -36,7 +30,7 @@ public class ClipboardManager {
|
|||
*/
|
||||
public void setText(String label, String text) {
|
||||
android.content.ClipboardManager clipboardManager =
|
||||
(android.content.ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
(android.content.ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
ClipData clip = ClipData.newPlainText(label, text);
|
||||
clipboardManager.setPrimaryClip(clip);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue