I'm attempting to start my Android Service/Library and I'm getting an error in my logcat stating: java.lang.RuntimeException: Unable to resume activity
I'm not sure exactly what I've done wrong in this instance - any suggestions or insight are much appreciated.
07-08 03:47:43.840: E/AndroidRuntime(2074): FATAL EXCEPTION: main
07-08 03:47:43.840: E/AndroidRuntime(2074): java.lang.RuntimeException: Unable to resume activity {com.example.project/com.example.project.ActivityMain}: java.lang.NullPointerException
07-08 03:47:43.840: E/AndroidRuntime(2074): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2742)
07-08 03:47:43.840: E/AndroidRuntime(2074): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2771)
07-08 03:47:43.840: E/AndroidRuntime(2074): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2235)
07-08 03:47:43.840: E/AndroidRuntime(2074): at android.app.ActivityThread.access$600(ActivityThread.java:141)
07-08 03:47:43.840: E/AndroidRuntime(2074): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
07-08 03:47:43.840: E/AndroidRuntime(2074): at android.os.Handler.dispatchMessage(Handler.java:99)
07-08 03:47:43.840: E/AndroidRuntime(2074): at android.os.Looper.loop(Looper.java:137)
07-08 03:47:43.840: E/AndroidRuntime(2074): at android.app.ActivityThread.main(ActivityThread.java:5041)
07-08 03:47:43.840: E/AndroidRuntime(2074): at java.lang.reflect.Method.invokeNative(Native Method)
07-08 03:47:43.840: E/AndroidRuntime(2074): at java.lang.reflect.Method.invoke(Method.java:511)
07-08 03:47:43.840: E/AndroidRuntime(2074): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
07-08 03:47:43.840: E/AndroidRuntime(2074): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
07-08 03:47:43.840: E/AndroidRuntime(2074): at dalvik.system.NativeStart.main(Native Method)
07-08 03:47:43.840: E/AndroidRuntime(2074): Caused by: java.lang.NullPointerException
07-08 03:47:43.840: E/AndroidRuntime(2074): at android.app.ContextImpl.startServiceAsUser(ContextImpl.java:1373)
07-08 03:47:43.840: E/AndroidRuntime(2074): at android.app.ContextImpl.startService(ContextImpl.java:1361)
07-08 03:47:43.840: E/AndroidRuntime(2074): at android.content.ContextWrapper.startService(ContextWrapper.java:450)
07-08 03:47:43.840: E/AndroidRuntime(2074): at com.example.project.ActivityMain.onResume(ActivityMain.java:485)
07-08 03:47:43.840: E/AndroidRuntime(2074): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1185)
07-08 03:47:43.840: E/AndroidRuntime(2074): at android.app.Activity.performResume(Activity.java:5182)
07-08 03:47:43.840: E/AndroidRuntime(2074): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2732)
07-08 03:47:43.840: E/AndroidRuntime(2074): ... 12 more
Source Snippet:
@Override
protected void onResume() {
super.onResume();
restoreSharedPreferences();
updateStatusBar();
startService(intent);
registerReceiver(broadcastReceiver, new IntentFilter(Timer.BROADCAST_ACTION));
}
PS
If any additional code or information regarding the app is necessary I will be happy to provide it promptly.
0 comments:
Post a Comment