package org.litepal;

import org.litepal.exceptions.GlobalException;

import android.app.Application;
import android.content.Context;

/**
 * Base class of LitePal to make things easier when developers need to use
 * context. When you need context, just use
 * <b>LitePalApplication.getContext()</b>. To make this function work, you need
 * to configure your AndroidManifest.xml. Specifying
 * <b>"org.litepal.LitePalApplication"</b> as the application name in your
 * &lt;application&gt; tag to enable LitePal get the context. Of course if you
 * need to write your own Application class, LitePal can still live with that.
 * But just remember make your own Application class inherited from
 * LitePalApplication instead of inheriting from Application directly. This can
 * make all things work without side effects.
 * 
 * @author Tony Green
 * @since 1.0
 */
public class LitePalApplication extends Application {

	/**
	 * Global application context.
	 */
	private static Context mContext;

	/**
	 * Initialize application context.
	 */
	@Override
	public void onCreate() {
		super.onCreate();
		mContext = getApplicationContext();
	}

	/**
	 * Get the global application context.
	 * 
	 * @return Application context.
	 * @throws GlobalException
	 */
	public static Context getContext() {
		if (mContext == null) {
			throw new GlobalException(GlobalException.APPLICATION_CONTEXT_IS_NULL);
		}
		return mContext;
	}

	@Override
	public void onLowMemory() {
		super.onLowMemory();
		mContext = getApplicationContext();
	}

}

@@ -995,16 +995,49 @@
 %09/**%0A%09 *
+ Construct of LitePalApplication.
  Initial
@@ -1071,100 +1071,55 @@
 */%0A%09
-@Override%0A%09public void onCreate() %7B%0A%09%09super.onCreate();%0A%09%09mContext = getApplicationContext()
+public LitePalApplication() %7B%0A%09%09mContext = this
 ;%0A%09%7D

Fix bug. If use onCreate to initialize application context, when subclass don't invoke with super, the context will not be initialized. So use constructor instead.