不解釋。
Month:May 2015
Found 12 records. At Page 1 / 3.
因為Arrays.asList會強制固定長度。
只能用以下方法把Array宣告成List,可以正常使用。
List<String> list = new LinkedList<String>(Arrays.asList(split));
僅此作為筆記。
This entry was posted in Experience, Functions, Java By Weil Jimmer.
private void msg_box(String title, String msg) {
AlertDialog.Builder alertDialog = new AlertDialog.Builder(this);
alertDialog.setTitle(title);
//alertDialog.setPositiveButton("OK", this);
//alertDialog.setNegativeButton("Cancel", this);
alertDialog.setMessage(msg);
alertDialog.show();
}
This entry was posted in Functions, Java By Weil Jimmer.
使用 getSharedPreferences 函數儲存數據。
APP_NAME 改成 想設計的名稱,如:org.twgogo.wbf.Code_.web_browser
public boolean set_config(String str,String name_){
SharedPreferences sharedPref = getSharedPreferences("APP_NAME", MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPref.edit();
editor.putString(name_, str);
editor.apply();
return true;
}
public String read_config(String name_){
SharedPreferences sharedPref = getSharedPreferences("APP_NAME", MODE_PRIVATE);
return sharedPref.getString(name_,"NULL");
}
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