Mobile terminal to the clipboard copy content

Switch (plus.os.name) {
Case 'the iOS':
// Get clipboard
var UIPasteboard = plus.ios.importClass ( "UIPasteboard");
var generalPasteboard UIPasteboard.generalPasteboard = ();
// Set / Get the text
generalPasteboard.setValueforPasteboardType ( 'copy', "public.utf8--Plain-text");
var value = generalPasteboard.valueForPasteboardType ( "Plain-public.utf8--text");
BREAK;
Case 'the Android':
var = plus.android the Context .importClass ( "android.content.Context");
var = plus.android.runtimeMainActivity main ();
var = main.getSystemService Clip (Context.CLIPBOARD_SERVICE);
plus.android.invoke (Clip, "the setText", 'I am copied ');
BREAK;
}
Alert ( 'successfully copied')

Guess you like

Origin www.cnblogs.com/lymconch/p/11309465.html