1
我有這樣的代碼:如何修改屬性的XML文件(Android Studio中)
private Properties properties;
private static final String myFile = "properties.xml";
// code for properties
File file = new File(getFilesDir(), myFile);
properties = new Properties();
try{
if(file.exists()){
FileInputStream fish = openFileInput(myFile);
properties.loadFromXML(fis);
fis.close();
Toast.makeText(this, "LOADED FROM STORAGE", Toast.LENGTH_SHORT).show();
} else {
FileOutputStream fosa = openFileOutput(myFile, Context.MODE_PRIVATE);
properties.storeToXML(fos, null);
fos.close();
Toast.makeText(this, "CREATED THE FILE", Toast.LENGTH_SHORT).show();
}
}catch(Exception e){
Log.wtf("MAIN", "error loading file");
}
而且我想進入該屬性生成xml文件,但它doen't出現在Android工作室項目,有誰知道我能在哪裏找到它,或者如何通過代碼修改它?
它是在[內部存儲(https://commonsware.com/blog/2014/04/07/storage-situation-internal-storage .html)您運行代碼的設備或模擬器。 – CommonsWare