bug 590349 - Clipboard (copy/paste) support for Android r=mwu a=blocking-fennec=2.0+

This commit is contained in:
Brad Lassey
2010-08-26 19:43:23 -04:00
parent f885362b97
commit 5354987d41
7 changed files with 277 additions and 1 deletions

View File

@@ -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);
}
}