I have a class that sends some info to the mysql db.
I want from this class to use the Shared Preferences methods but they are belong to the activity class.
My class extends AsyncTask so I can’t extend another.. I tried to create an activity instance and use it but my program has stoped. something like this:
Activity a1 = new Activity();
SharedPreferenecs loginInfo = a1.getSharedPreferences("MyKid", 0);
etc ..
pass the Context of your
Activityin non Activity class’s Constructor.and then use