Back to project page saostar.
The source code is released under:
Apache License
If you think the Android project saostar listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package net.azyobuzi.azyotter.saostar; /*from w w w .j av a2 s . c om*/ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import android.content.Context; import android.content.SharedPreferences; import android.content.res.Resources; import android.preference.PreferenceManager; public class ContextAccess { private static Context context; public static void setContext(Context ctx) { context = ctx; } public static Resources getResources() { return context.getResources(); } public static CharSequence getText(int resId) { return context.getText(resId); } public static String getString(int resId) { return context.getString(resId); } public static FileInputStream openFileInput(String fileName) throws FileNotFoundException { return context.openFileInput(fileName); } public static FileOutputStream openFileOutput(String fileName, int mode) throws FileNotFoundException { return context.openFileOutput(fileName, mode); } public static SharedPreferences getDefaultSharedPreferences() { return PreferenceManager.getDefaultSharedPreferences(context); } public static SharedPreferences getSharedPreferences(String name, int mode) { return context.getSharedPreferences(name, mode); } public static void setTheme(int resid) { context.setTheme(resid); } }