I have added an option to apply different theme for my android phone. while applying i am starting an async task. If i change the orientation while applying it i am getting an Error which is given below.
01-01 00:19:25.140: ERROR/AndroidRuntime(3553): FATAL EXCEPTION: main
01-01 00:19:25.140: ERROR/AndroidRuntime(3553): java.lang.RuntimeException: Unable to resume activity {com.android.settings/com.android.settings.ThemeSettingsActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=null} to activity {com.android.settings/com.android.settings.ThemeSettingsActivity}: java.lang.NullPointerException
01-01 00:19:25.140: ERROR/AndroidRuntime(3553): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2471)
01-01 00:19:25.140: ERROR/AndroidRuntime(3553): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2499)
01-01 00:19:25.140: ERROR/AndroidRuntime(3553): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1994)
01-01 00:19:25.140: ERROR/AndroidRuntime(3553): at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3375)
01-01 00:19:25.140: ERROR/AndroidRuntime(3553): at android.app.ActivityThread.access$700(ActivityThread.java:125)
01-01 00:19:25.140: ERROR/AndroidRuntime(3553): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1153)
01-01 00:19:25.140: ERROR/AndroidRuntime(3553): at android.os.Handler.dispatchMessage(Handler.java:99)
01-01 00:19:25.140: ERROR/AndroidRuntime(3553): at android.os.Looper.loop(Looper.java:137)
01-01 00:19:25.140: ERROR/AndroidRuntime(3553): at android.app.ActivityThread.main(ActivityThread.java:4368)
01-01 00:19:25.140: ERROR/AndroidRuntime(3553): at java.lang.reflect.Method.invokeNative(Native Method)
01-01 00:19:25.140: ERROR/AndroidRuntime(3553): at java.lang.reflect.Method.invoke(Method.java:511)
01-01 00:19:25.140: ERROR/AndroidRuntime(3553): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-01 00:19:25.140: ERROR/AndroidRuntime(3553): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-01 00:19:25.140: ERROR/AndroidRuntime(3553): at dalvik.system.NativeStart.main(Native Method)
01-01 00:19:25.140: ERROR/AndroidRuntime(3553): Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=null} to activity {com.android.settings/com.android.settings.ThemeSettingsActivity}: java.lang.NullPointerException
01-01 00:19:25.140: ERROR/AndroidRuntime(3553): at android.app.ActivityThread.deliverResults(ActivityThread.java:3004)
01-01 00:19:25.140: ERROR/AndroidRuntime(3553): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2458)
01-01 00:19:25.140: ERROR/AndroidRuntime(3553): ... 13 more
01-01 00:19:25.140: ERROR/AndroidRuntime(3553): Caused by: java.lang.NullPointerException
01-01 00:19:25.140: ERROR/AndroidRuntime(3553): at com.android.settings.ThemeSettingsActivity.onActivityResult(ThemeSettingsActivity.java:308)
01-01 00:19:25.140: ERROR/AndroidRuntime(3553): at android.app.Activity.dispatchActivityResult(Activity.java:4649)
01-01 00:19:25.140: ERROR/AndroidRuntime(3553): at android.app.ActivityThread.deliverResults(ActivityThread.java:3000)
01-01 00:19:25.140: ERROR/AndroidRuntime(3553): ... 14 more
I am not able to find the reason of this please help.