2012-04-01 15:08:31 -04:00
|
|
|
package com.fsck.k9.helper;
|
|
|
|
|
2012-07-07 08:38:57 -04:00
|
|
|
import android.annotation.TargetApi;
|
2012-04-01 15:08:31 -04:00
|
|
|
import android.content.ClipData;
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.ClipboardManager;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Access the system clipboard using the new {@link ClipboardManager} introduced with API 11
|
|
|
|
*/
|
2012-07-07 08:38:57 -04:00
|
|
|
@TargetApi(11)
|
2012-04-01 15:08:31 -04:00
|
|
|
public class ClipboardManagerApi11 extends com.fsck.k9.helper.ClipboardManager {
|
|
|
|
|
|
|
|
public ClipboardManagerApi11(Context context) {
|
|
|
|
super(context);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setText(String label, String text) {
|
|
|
|
ClipboardManager clipboardManager =
|
|
|
|
(ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE);
|
|
|
|
ClipData clip = ClipData.newPlainText(label, text);
|
|
|
|
clipboardManager.setPrimaryClip(clip);
|
|
|
|
}
|
|
|
|
}
|