Hello! I have an XML file that contains some data and is in res / xml, and there is a function that needs to recreate this file with new data. Here is the function code:
void ListToXml() throws IOException { XmlSerializer serializer = Xml.newSerializer(); StringWriter writer = new StringWriter(); serializer.setOutput(writer); serializer.startDocument(null, true); serializer.startTag(null, "root"); for (int i=0; i<tovarList.size(); i++) { serializer.startTag(null,"element"); serializer.endTag(null, "element"); } serializer.endTag(null, "root"); serializer.endDocument(); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter( openFileOutput("res\\xml\\about_tovar.xml", MODE_PRIVATE))); bw.write(writer.toString()); bw.close(); } The problem with the record, no errors, but the file is not created. Help me please!