Methods Summary |
---|
private static IClipboard | getService()
if (sService != null) {
return sService;
}
IBinder b = ServiceManager.getService("clipboard");
sService = IClipboard.Stub.asInterface(b);
return sService;
|
public java.lang.CharSequence | getText()Returns the text on the clipboard. It will eventually be possible
to store types other than text too, in which case this will return
null if the type cannot be coerced to text.
try {
return getService().getClipboardText();
} catch (RemoteException e) {
return null;
}
|
public boolean | hasText()Returns true if the clipboard contains text; false otherwise.
try {
return getService().hasClipboardText();
} catch (RemoteException e) {
return false;
}
|
public void | setText(java.lang.CharSequence text)Sets the contents of the clipboard to the specified text.
try {
getService().setClipboardText(text);
} catch (RemoteException e) {
}
|