bug 590349 - Clipboard (copy/paste) support for Android r=mwu a=blocking-fennec=2.0+
This commit is contained in:
@@ -423,4 +423,20 @@ class GeckoAppShell
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static String getClipboardText() {
|
||||
Context context = GeckoApp.surfaceView.getContext();
|
||||
ClipboardManager cm = (ClipboardManager)
|
||||
context.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
if (!cm.hasText())
|
||||
return null;
|
||||
return cm.getText().toString();
|
||||
}
|
||||
|
||||
static void setClipboardText(String text) {
|
||||
Context context = GeckoApp.surfaceView.getContext();
|
||||
ClipboardManager cm = (ClipboardManager)
|
||||
context.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
cm.setText(text);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user