Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Properties props = new Properties();
- InputStream inputStream = null;
- try{
- inputStream = getBaseContext().getAssets().open("userInfo.properties");
- props.load(inputStream);
- props.put("name", "smith");
- FileOutputStream output = new FileOutputStream("userInfo.properties"); //this line throws error
- props.store(output, "This is overwrite file");
- String name = props.getProperty("name");
- Log.d(TAG, "onCreate: PROPERTIES TEST NAME CHANGE: " + name);
- } catch (IOException e) {
- e.printStackTrace();
- } finally {
- try {
- inputStream.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
Add Comment
Please, Sign In to add comment