Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE on RecyclerAdapter#getItemCount #4319

Open
hybd666 opened this issue Dec 29, 2024 · 0 comments
Open

NPE on RecyclerAdapter#getItemCount #4319

hybd666 opened this issue Dec 29, 2024 · 0 comments
Labels
Crash-NullPointerException Issue-Bug Related unexpected behavior or something worth investigating. Issue-Easy (good first issue) Beginners welcome! Issues with relative low difficulty.

Comments

@hybd666
Copy link

hybd666 commented Dec 29, 2024

Exception
App Name: Amaze File Manager
Version: 3.10
User Action: UI Error
Request: Application crash
OS: Linux Android 11 - 30
Device: Google Nexus 4

crash log

java.lang.RuntimeException: Unable to destroy activity {com.amaze.filemanager.debug/com.amaze.filemanager.ui.activities.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5111)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5140)
at android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:5432)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:5362)
at android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:69)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
at com.amaze.filemanager.adapters.RecyclerAdapter.getItemCount(RecyclerAdapter.java:686)
at com.amaze.filemanager.ui.views.FastScroller.invalidateVisibility(FastScroller.java:158)
at com.amaze.filemanager.ui.views.FastScroller.-$$Nest$minvalidateVisibility(Unknown Source:0)
at com.amaze.filemanager.ui.views.FastScroller$1.onChildViewRemoved(FastScroller.java:237)
at android.view.ViewGroup.dispatchViewRemoved(ViewGroup.java:5136)
at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5585)
at android.view.ViewGroup.removeViewAt(ViewGroup.java:5507)
at androidx.recyclerview.widget.RecyclerView$5.removeViewAt(RecyclerView.java:882)
at androidx.recyclerview.widget.ChildHelper.removeViewIfHidden(ChildHelper.java:386)
at androidx.recyclerview.widget.RecyclerView.removeAnimatingView(RecyclerView.java:1452)
at androidx.recyclerview.widget.RecyclerView$ItemAnimatorRestoreListener.onAnimationFinished(RecyclerView.java:12699)
at androidx.recyclerview.widget.RecyclerView$ItemAnimator.dispatchAnimationFinished(RecyclerView.java:13199)
at androidx.recyclerview.widget.SimpleItemAnimator.dispatchChangeFinished(SimpleItemAnimator.java:317)
at androidx.recyclerview.widget.DefaultItemAnimator$7.onAnimationEnd(DefaultItemAnimator.java:370)
at android.view.ViewPropertyAnimator$AnimatorEventListener.onAnimationEnd(ViewPropertyAnimator.java:1111)
at android.animation.Animator$AnimatorListener.onAnimationEnd(Animator.java:554)
at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1250)
at android.animation.ValueAnimator.cancel(ValueAnimator.java:1135)
at android.view.ViewPropertyAnimator.cancel(ViewPropertyAnimator.java:424)
at androidx.recyclerview.widget.DefaultItemAnimator.cancelAll(DefaultItemAnimator.java:642)
at androidx.recyclerview.widget.DefaultItemAnimator.endAnimations(DefaultItemAnimator.java:635)
at androidx.recyclerview.widget.RecyclerView.onDetachedFromWindow(RecyclerView.java:2996)
at android.view.View.dispatchDetachedFromWindow(View.java:20534)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3942)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3934)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3934)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3934)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3934)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3934)
at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3934)
at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5560)
at android.view.ViewGroup.removeViewInternal(ViewGroup.java:5531)
at android.view.ViewGroup.removeView(ViewGroup.java:5462)
at androidx.fragment.app.SpecialEffectsController$Operation$State.applyState(SpecialEffectsController.java:470)
at androidx.fragment.app.SpecialEffectsController$1.run(SpecialEffectsController.java:211)
at androidx.fragment.app.SpecialEffectsController$Operation.complete(SpecialEffectsController.java:713)
at androidx.fragment.app.SpecialEffectsController$FragmentStateManagerOperation.complete(SpecialEffectsController.java:770)
at androidx.fragment.app.SpecialEffectsController$Operation.cancel(SpecialEffectsController.java:615)
at androidx.fragment.app.SpecialEffectsController.forceCompleteAllOperations(SpecialEffectsController.java:350)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2982)
at androidx.fragment.app.FragmentManager.dispatchDestroy(FragmentManager.java:2933)
at androidx.fragment.app.FragmentController.dispatchDestroy(FragmentController.java:346)
at androidx.fragment.app.FragmentActivity.onDestroy(FragmentActivity.java:259)
at androidx.appcompat.app.AppCompatActivity.onDestroy(AppCompatActivity.java:283)
at com.amaze.filemanager.ui.activities.superclasses.ThemedActivity.onDestroy(ThemedActivity.java:348)
at com.amaze.filemanager.ui.activities.MainActivity.onDestroy(MainActivity.java:1462)
at android.app.Activity.performDestroy(Activity.java:8239)
at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1344)
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:5096)
... 13 more

@VishnuSanal VishnuSanal changed the title java.lang.RuntimeException: Unable to destroy MainActivity NPE on RecyclerAdapter#getItemCount Dec 30, 2024
@VishnuSanal VishnuSanal added Issue-Bug Related unexpected behavior or something worth investigating. Issue-Easy (good first issue) Beginners welcome! Issues with relative low difficulty. Crash-NullPointerException labels Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Crash-NullPointerException Issue-Bug Related unexpected behavior or something worth investigating. Issue-Easy (good first issue) Beginners welcome! Issues with relative low difficulty.
Projects
None yet
Development

No branches or pull requests

2 participants