My app needs location fixes on regular basis, even when the phone is not awake. To do this, I am using IntentService with the pattern generously provided by Commonsware. htt
For others like me: I had a similar problem related to AsyncTask. As I understand, that class assumes that it is initialized on the UI (main) thread.
A workaround (one of several possible) is to place the following in MyApplication class:
@Override
public void onCreate() {
// workaround for http://code.google.com/p/android/issues/detail?id=20915
try {
Class.forName("android.os.AsyncTask");
} catch (ClassNotFoundException e) {}
super.onCreate();
}
(do not forget to mention it in AndroidManifest.xml:
)