views:

12

answers:

0

I'm have a User Class in my Android application that pulls out information from SharedPreferences I find myself instantiating the class within an Android Activity

User currentUser = new User(this);

I then go on to use the context to get the preferences.

userName = context.getSharedPreferences("UserName", Context.MODE_PRIVATE);

I have a new need to instantiate the User in another class, unfortunately, it does not have a context readily Available. Should I change my User Class to inherit from Activity or is there another more appropriate class for me to Inherit from.

Thanks!