,内存卡
2.1数据保存
File file=new File(Environment.getExternalStorageDirectory(), name); try { FileOutputStream fos.write(content.getBytes()); fos.close(); } catch (Exception e) { e.printStackTrace(); }
|
2.2数据读取
File file=new File(Environment.getExternalStorageDirectory(), name); try { FileOutputStream fos.write(content.getBytes()); fos.close(); } catch (Exception e) { e.printStackTrace(); } |
3,sharedprefrence (****)
btn_ok.setOnClickListener(new OnClickListener() {
@Override public void onClick(View v) {
String String if(user.isEmpty()||pwd.isEmpty()){ Toast.makeText(getApplicationContext(), “不能为空”, 200).show(); //获取编辑器 //保存数据 //提交保存 } } }); |
原创文章,作者:carmelaweatherly,如若转载,请注明出处:https://blog.ytso.com/194358.html