1


I just started to use action bar and tab navigation. App is running good, but i have problems when the phone goes to sleep, i wake it up, and i go to the next tab I get this exception and i don't know where to look. Exception is:

03-07 11:16:57.026: E/AndroidRuntime(20228): FATAL EXCEPTION: main
03-07 11:16:57.026: E/AndroidRuntime(20228): java.lang.NullPointerException
03-07 11:16:57.026: E/AndroidRuntime(20228):    at android.view.View.dispatchRestoreInstanceState(View.java:6326)
03-07 11:16:57.026: E/AndroidRuntime(20228):    at android.view.View.restoreHierarchyState(View.java:6310)
03-07 11:16:57.026: E/AndroidRuntime(20228):    at com.actionbarsherlock.internal.view.menu.MenuBuilder.restoreActionViewStates(MenuBuilder.java:361)
03-07 11:16:57.026: E/AndroidRuntime(20228):    at com.actionbarsherlock.internal.ActionBarSherlockCompat.preparePanel(ActionBarSherlockCompat.java:503)
03-07 11:16:57.026: E/AndroidRuntime(20228):    at com.actionbarsherlock.internal.ActionBarSherlockCompat.dispatchInvalidateOptionsMenu(ActionBarSherlockCompat.java:272)
03-07 11:16:57.026: E/AndroidRuntime(20228):    at com.actionbarsherlock.app.SherlockFragmentActivity.invalidateOptionsMenu(SherlockFragmentActivity.java:150)
03-07 11:16:57.026: E/AndroidRuntime(20228):    at com.actionbarsherlock.app.SherlockFragmentActivity.supportInvalidateOptionsMenu(SherlockFragmentActivity.java:156)
03-07 11:16:57.026: E/AndroidRuntime(20228):    at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1100)
03-07 11:16:57.026: E/AndroidRuntime(20228):    at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
03-07 11:16:57.026: E/AndroidRuntime(20228):    at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1444)
03-07 11:16:57.026: E/AndroidRuntime(20228):    at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:429)
03-07 11:16:57.026: E/AndroidRuntime(20228):    at android.os.Handler.handleCallback(Handler.java:587)
03-07 11:16:57.026: E/AndroidRuntime(20228):    at android.os.Handler.dispatchMessage(Handler.java:92)
03-07 11:16:57.026: E/AndroidRuntime(20228):    at android.os.Looper.loop(Looper.java:130)
03-07 11:16:57.026: E/AndroidRuntime(20228):    at android.app.ActivityThread.main(ActivityThread.java:3687)
03-07 11:16:57.026: E/AndroidRuntime(20228):    at java.lang.reflect.Method.invokeNative(Native Method)
03-07 11:16:57.026: E/AndroidRuntime(20228):    at java.lang.reflect.Method.invoke(Method.java:507)
03-07 11:16:57.026: E/AndroidRuntime(20228):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
03-07 11:16:57.026: E/AndroidRuntime(20228):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
03-07 11:16:57.026: E/AndroidRuntime(20228):    at dalvik.system.NativeStart.main(Native Method)
Jovan
  • 1,741
  • 4
  • 19
  • 38
  • I'm missing the statement 'caused by' in your logcat. Is this all? – RvdK Mar 07 '13 at 10:23
  • This is all...this confuse me to... – Jovan Mar 07 '13 at 10:25
  • 2
    First thing, it is stupid, not stuppid.. :-) Second thing, [this](https://github.com/JakeWharton/ActionBarSherlock/issues/652) bug reported in their github page looks similar, and they tell about a fix.. Might help you.. – Krishnabhadra Mar 07 '13 at 10:25
  • :D Mistake..forgive me, but english is not my mother language! :) Yes it look like that this is the problem. I just asked how to fix it. – Jovan Mar 07 '13 at 10:53
  • I found a fix that is not implemented in sherlock library. If you post you answer i will check it as true! :) Thanks man.. – Jovan Mar 07 '13 at 11:15
  • @Jovan if you found a different fix from the one mentioned in the link, then it is better you post it as answer yourself because that is the answer worked for you. And that might be the answer that works for future visitors. If the fix you found is present in the above link, then I can post it as answer.. – Krishnabhadra Mar 07 '13 at 11:20

1 Answers1

0

It seems like a bug in ActionBarSherlock implementation. See discussion about the bug here. And someone uploaded a patch here. Check if that works for you.

Krishnabhadra
  • 34,169
  • 30
  • 118
  • 167