Public Sub SetText(txt As String) As Boolean
Dim r As Reflector
Dim jo As JavaObject
jo = Me
Dim bOk As Boolean
bOk = jo.RunMethod("SetTextToClipboard", Array As Object(txt, r.GetContext))
Return bOk
End Sub
Public Sub ClrText() As Boolean
...??...
End Sub
#IF JAVA
import android.content.ClipboardManager;
import android.content.ClipData;
import android.content.ClipDescription;
import android.content.Context;
public Boolean SetTextToClipboard(Object objtxt, Object mObjContext) {
try{
String txt = (String) objtxt;
Context mContext = (Context) mObjContext;
ClipboardManager myClipboard = (ClipboardManager) mContext.getSystemService("clipboard");
ClipData myClip;
myClip = ClipData.newPlainText("text", txt);
myClipboard.setPrimaryClip(myClip);
return true;
}
catch(Exception ex){
return false;
}
};
...
#End If