【发布时间】:2011-03-23 22:23:55
【问题描述】:
我正在尝试将 url 保存为字符串,以便我可以在我的应用程序的另一部分使用它,但它无法正常工作。这就是我所拥有的。
保存
String FILENAME = "usertimetable";
String string = mWebView.getOriginalUrl();
FileOutputStream fos = null;
try {
fos = openFileOutput(FILENAME, Context.MODE_PRIVATE);
fos.write(string.getBytes());
fos.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
开幕
FileInputStream fis = null;
try {
fis = openFileInput("usertimetable");
url = fis.toString();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
【问题讨论】: