Код: Выделить всё
void save(Context context, String fileName) {
// Write the field as XML.
String xmlFileName = fileName.endsWith(EXT_XML) ? fileName : fileName
+ EXT_XML;
FileOutputStream xmlFos;
try {
xmlFos = context.openFileOutput(xmlFileName, Context.MODE_PRIVATE);
} catch (IOException ex) {
throw new RuntimeException(ex.getMessage());
}
serializeXml(xmlFos);
Подробнее здесь: https://stackoverflow.com/questions/795 ... oexception