Back to project page DualReader-Android.
The source code is released under:
Apache License
If you think the Android project DualReader-Android 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 com.diego4aim.dualreader.util; /*from w w w. j av a2s . c o m*/ import android.app.Application; import android.content.Context; /** * Facility to help non-Android-specific classes reach the {@link Application} * environment. * <p/> * If you want the application resources to be available everywhere, modify the * application manifest (AndroidManifest.xml) by adding this attribute to the * <application> element: * <p/> * android:name="com.diego4aim.dualreader.util.GlobalContextApplication" */ public class GlobalContextApplication extends Application { private static Context mContext = null; /** * Exposes the application Context, allowing any component in the * application to access resources like * <p/> * GlobalContextApplication.getContext().getResources()... */ public static Context getContext() { return mContext; } @Override public void onCreate() { super.onCreate(); mContext = getApplicationContext(); } }