Android应用程序设计教程第5章 数据存储.pptVIP

  • 10
  • 0
  • 约1.83万字
  • 约 74页
  • 2020-04-30 发布于辽宁
  • 举报

Android应用程序设计教程第5章 数据存储.ppt

//取得数据 extUser.setText(properties.getProperty(account).toString());//读取属性数据 extPassword.setText(properties.getProperty(password).toString());//读取属性数据 } private boolean save(){ Properties properties=new Properties();//创建Properties对象 //将数据打包成Properties properties.put(account,extUser.getText().toString()); properties.put(password,extPassword.getText().toString()); try{ FileOutputStream stream=this.openFileOutput(user.cfg, Context.MODE_WORLD_WRITEABLE);//创建FileOutputStream对象,向文件写数据 properties.store(stream,);//将properties数据写入文件 }catch(FileNotFoundExc

文档评论(0)

1亿VIP精品文档

相关文档