Hey everybody,
I'm working with a XMLSerializer and need to use the OpenFileOutput function
within the Context.
Since Mono 4.0 I always get an exception (System.NullReferenceException)
here, which was not thrown in the old version.
I think in the old version the file was created automatically, when using
the method Context.OpenFileOutput now it seems like the method only opens an
already existing file.
To reproduce the error I'll give you the following code:
public class XMLSource
{
private static XMLSource _instance;
private bool initial = true;
private List<string> _paths;
private Context _context;
public static XMLSource Instance
{
get
{
if (_instance == null)
_instance = new XMLSource();
return _instance;
}
}
public Context Context
{
get
{
return _context;
}
set
{
if (_context != value)
_context = value;
}
}
private XMLSource()
{
_paths = new List<string>();
SavePrimitive("asd");
}
public void SavePrimitive(string name)
{
_context.OpenFileOutput(name, FileCreationMode.WorldReadable);
}
Can anyone help me here or does know a solution?
Regards,
Susanne
--
View this message in context:
http://mono-for-android.1047100.n5.nabble.com/OpenFileOutput-Exception-Mono-4-0-tp5073997p5073997.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid