Download presentation
Presentation is loading. Please wait.
1
剪貼簿
2
用法 引入物件類別 宣告物件變數 import android.content.ClipData;
import android.content.ClipboardManager; 宣告物件變數 private ClipboardManager myClipboard; private ClipData myClip;
3
取得物件參考 myClipboard = (ClipboardManager)getSystemService(CLIPBOARD_SERVICE); 複製與儲存 String data=txtData.getText().toString(); myClip = ClipData.newPlainText("text", data); myClipboard.setPrimaryClip(myClip);
4
取值與貼上 ClipData abc = myClipboard.getPrimaryClip();
ClipData.Item itm = abc.getItemAt(0); String text = itm.getText().toString(); edText[txtID].setText(text);
Similar presentations