Possible Duplicate:
What is Context in Android?
I would like to have an answer on this question Android – SharedPreferences with serializable object:
LocalPersistence LP=new LocalPersistence();
Asortiment=(Nomenklatura) LP.readObjectFromFile(???, filename);
But can’t understand what to pass instead of Context context in main activity?
If you are in the
Activity, you can passthis. Otherwise (for example if you are inside another class), you can always useMyActivity.thisto get a app-wide available reference to the activity object (there is always only one).