I have the following XML file:
<setting>
<time>12</time>
</setting>
I used the following code to update the time value.
File file = getFileStreamPath("settings.xml");
DocumentBuilder builder=DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc=builder.parse(file);
NodeList t=doc.getElementsByTagName("time");
Node nNode = t.item(0);
String s=time.getText().toString();
nNode.setNodeValue(s);
Unfortunately the file hasn't been updated. So how could I save the updates in the xml file?