You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Process: com.owncloud.android, PID: 7761 java.lang.NullPointerException: Attempt to invoke interface method 'boolean android.view.ActionMode$Callback.onCreateActionMode(android.view.ActionMode, android.view.Menu)' on a null object reference at com.android.internal.policy.PhoneWindow$DecorView$ActionModeCallback2Wrapper.onCreateActionMode(PhoneWindow.java:3531) at android.support.v7.view.SupportActionModeWrapper$CallbackWrapper.onCreateActionMode(SupportActionModeWrapper.java:155) at android.support.v7.app.AppCompatDelegateImplV7$ActionModeCallbackWrapperV7.onCreateActionMode(AppCompatDelegateImplV7.java:1695) at android.support.v7.app.WindowDecorActionBar$ActionModeImpl.dispatchOnCreate(WindowDecorActionBar.java:1008) at android.support.v7.app.WindowDecorActionBar.startActionMode(WindowDecorActionBar.java:498) at android.support.v7.app.AppCompatDelegateImplV7.startSupportActionMode(AppCompatDelegateImplV7.java:645) at android.support.v7.app.AppCompatDelegateImplV14$AppCompatWindowCallbackV14.startAsSupportActionMode(AppCompatDelegateImplV14.java:74) at android.support.v7.app.AppCompatDelegateImplV23$AppCompatWindowCallbackV23.onWindowStartingActionMode(AppCompatDelegateImplV23.java:47) at com.android.internal.policy.PhoneWindow$DecorView.startActionMode(PhoneWindow.java:2748) at com.android.internal.policy.PhoneWindow$DecorView.startActionModeForChild(PhoneWindow.java:2729) at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:812) at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:812) at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:812) at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:812) at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:812) at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:812) at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:812) at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:812) at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:812) at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:812) at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:812) at android.view.View.startActionMode(View.java:5335) at android.view.View.startActionMode(View.java:5319) at android.widget.AbsListView.performLongPress(AbsListView.java:3118) at android.widget.AbsListView$CheckForLongPress.run(AbsListView.java:3059) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
I've been reviewing deeply the code, and I found some possible clues about the crash:
OCFileListFragment::registerLongClickListener()
Maybe the method onItemCheckedStateChanged is not the suitable one to inflate the context menu. In addittion, the menu is being created each time an element is selected or unselected.
I think we can handle it creating the menu into the method onCreateActionMode, and filter the shown options as is done before with the old menu.
The MultiChoiceModeListener was being attached to the current AbsListView when you call the method registerLongClickListener(). But if you change the view mode, the new AbsListView, in this case the GridView, doesn't have any listener set.
I'm fixing this currently I'll push the changes ASAP ;)
Activity
tobiasKaminsky commentedon May 2, 2016
Process: com.owncloud.android, PID: 7761 java.lang.NullPointerException: Attempt to invoke interface method 'boolean android.view.ActionMode$Callback.onCreateActionMode(android.view.ActionMode, android.view.Menu)' on a null object reference at com.android.internal.policy.PhoneWindow$DecorView$ActionModeCallback2Wrapper.onCreateActionMode(PhoneWindow.java:3531) at android.support.v7.view.SupportActionModeWrapper$CallbackWrapper.onCreateActionMode(SupportActionModeWrapper.java:155) at android.support.v7.app.AppCompatDelegateImplV7$ActionModeCallbackWrapperV7.onCreateActionMode(AppCompatDelegateImplV7.java:1695) at android.support.v7.app.WindowDecorActionBar$ActionModeImpl.dispatchOnCreate(WindowDecorActionBar.java:1008) at android.support.v7.app.WindowDecorActionBar.startActionMode(WindowDecorActionBar.java:498) at android.support.v7.app.AppCompatDelegateImplV7.startSupportActionMode(AppCompatDelegateImplV7.java:645) at android.support.v7.app.AppCompatDelegateImplV14$AppCompatWindowCallbackV14.startAsSupportActionMode(AppCompatDelegateImplV14.java:74) at android.support.v7.app.AppCompatDelegateImplV23$AppCompatWindowCallbackV23.onWindowStartingActionMode(AppCompatDelegateImplV23.java:47) at com.android.internal.policy.PhoneWindow$DecorView.startActionMode(PhoneWindow.java:2748) at com.android.internal.policy.PhoneWindow$DecorView.startActionModeForChild(PhoneWindow.java:2729) at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:812) at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:812) at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:812) at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:812) at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:812) at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:812) at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:812) at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:812) at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:812) at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:812) at android.view.ViewGroup.startActionModeForChild(ViewGroup.java:812) at android.view.View.startActionMode(View.java:5335) at android.view.View.startActionMode(View.java:5319) at android.widget.AbsListView.performLongPress(AbsListView.java:3118) at android.widget.AbsListView$CheckForLongPress.run(AbsListView.java:3059) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)tobiasKaminsky commentedon May 2, 2016
I do not understand where it comes from...
@AndyScherzinger maybe you have an idea?
It happens definitively only the first time after a fresh installation.
AndyScherzinger commentedon May 2, 2016
@tobiasKaminsky I am clueless :( Also no idea where this comes from.
malkomich commentedon May 19, 2016
I've been reviewing deeply the code, and I found some possible clues about the crash:
OCFileListFragment::registerLongClickListener()Maybe the method
onItemCheckedStateChangedis not the suitable one to inflate the context menu. In addittion, the menu is being created each time an element is selected or unselected.I think we can handle it creating the menu into the method
onCreateActionMode, and filter the shown options as is done before with the old menu.malkomich commentedon May 20, 2016
OK Problem found 😄
The
MultiChoiceModeListenerwas being attached to the currentAbsListViewwhen you call the methodregisterLongClickListener(). But if you change the view mode, the newAbsListView, in this case the GridView, doesn't have any listener set.I'm fixing this currently I'll push the changes ASAP ;)
malkomich commentedon May 20, 2016
Fixed on PR #1176
You can review it @tobiasKaminsky @AndyScherzinger ^^
tobiasKaminsky commentedon May 20, 2016
Great @malkomich!
I will test later!
jesmrec commentedon Jun 28, 2016
Fixed!!!
davivel commentedon Jul 5, 2016
Then we can close :)