ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("label", "Text to copy");
clipboard.setPrimaryClip(clip);
This entry was posted in Java By Weil Jimmer.
public class ExcuteAsyncTaskOperation extends AsyncTask<Void, Integer, String>{
@Override
protected void onPreExecute() {
//執行UI設定
super.onPreExecute();
}
@Override
protected String doInBackground(Void... params) {
//進行背景工作,如「Network」,並可轉發值。
//在迴圈中使用publishProgress((onProgressUpdate引數類別)變數);以傳遞資料。
//例如publishProgress((int)50);
return null;
}
@Override
protected void onProgressUpdate(Integer... progress) {
//設定更新進程條
//setProgressPercent(progress[0]);
}
@Override
protected void onPostExecute(String result) {
//結束,更新UI介面
super.onPostExecute(result);
}
}
運行方法
new ExcuteAsyncTaskOperation().execute();
This entry was posted in Java, Note By Weil Jimmer.
因為Arrays.asList會強制固定長度。
只能用以下方法把Array宣告成List,可以正常使用。
List<String> list = new LinkedList<String>(Arrays.asList(split));
僅此作為筆記。
This entry was posted in Experience, Functions, Java By Weil Jimmer.
White Birch Forum © Copyright
©2010- W.B.F. All Rights Reserved.
Weil Jimmer Web PHP Script