Question: I'm currently using a Parser and it parses every time the onCreate gets called.
My parser uses an XML file that's located in my assetfolder.

Is there any chance that I can make it parse only once, instead of every time I rotate the screen or restart the application?

Thank you :)

Answer: 
Persist a flag using the Preferences system the first time you complete a parse, and check this each time before parsing again. Do all this in your OnCreate() method.

```
    SharedPreferences settings = getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE);
    if (!settings.getBoolean("parsed", false)) {
        parseTheXML();

        SharedPreferences.Editor editor = settings.edit();
        editor.putBoolean("parsed",  true);
        editor.commit();
    }

```

There are other ways but this has the advantage of working across app reloads/phone power cycles - assuming that's what you want.
You can parse your XML in a "Application" object and have it accessible from there. Check out the documentation at <http://developer.android.com/reference/android/app/Application.html>