引用自:
Category:Java
Found 13 records. At Page 3 / 3.
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