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

Empty method with @Click annotation make app crash: NullPointerException #178

Open
TechNov opened this issue May 19, 2022 · 0 comments
Open

Comments

@TechNov
Copy link

TechNov commented May 19, 2022

Hi, When you declare a method that content is empty in the ChildView,
when you click on the parent item, Appp crash.

com.mindorks.placeholderview.ViewBinder in bindClick at line 152
com.mindorks.placeholderview.ViewBinder in bindView at line 45
com.mindorks.placeholderview.ExpandableViewBinder in bindView at line 114
com.mindorks.placeholderview.ViewAdapter in onBindViewHolder at line 50
com.mindorks.placeholderview.ViewAdapter in onBindViewHolder at line 17
androidx.recyclerview.widget.RecyclerView$Adapter in onBindViewHolder at line 6781
androidx.recyclerview.widget.RecyclerView$Adapter in bindViewHolder at line 6823
androidx.recyclerview.widget.RecyclerView$Recycler in tryBindViewHolderByDeadline at line 5752
androidx.recyclerview.widget.RecyclerView$Recycler in tryGetViewHolderForPositionByDeadline at line 6019
androidx.recyclerview.widget.RecyclerView$Recycler in getViewForPosition at line 5858
androidx.recyclerview.widget.RecyclerView$Recycler in getViewForPosition at line 5854
androidx.recyclerview.widget.LinearLayoutManager$LayoutState in next at line 2230
androidx.recyclerview.widget.LinearLayoutManager in layoutChunk at line 1557
androidx.recyclerview.widget.LinearLayoutManager in fill at line 1517
androidx.recyclerview.widget.LinearLayoutManager in onLayoutChildren at line 612
androidx.recyclerview.widget.RecyclerView in dispatchLayoutStep2 at line 3924
androidx.recyclerview.widget.RecyclerView in onMeasure at line 3336
android.view.View in measure at line 27131
android.view.ViewGroup in measureChildWithMargins at line 7951
android.widget.LinearLayout in measureChildBeforeLayout at line 1552
android.widget.LinearLayout in measureVertical at line 842
android.widget.LinearLayout in onMeasure at line 721
android.view.View in measure at line 27131
android.view.ViewGroup in measureChildWithMargins at line 7951
android.widget.LinearLayout in measureChildBeforeLayout at line 1552
android.widget.LinearLayout in measureVertical at line 842
android.widget.LinearLayout in onMeasure at line 721
android.view.View in measure at line 27131
android.view.ViewGroup in measureChildWithMargins at line 7951
android.widget.FrameLayout in onMeasure at line 194
android.view.View in measure at line 27131
android.view.ViewGroup in measureChildWithMargins at line 7951
androidx.coordinatorlayout.widget.CoordinatorLayout in onMeasureChild at line 733
com.google.android.material.appbar.HeaderScrollingViewBehavior in onMeasureChild at line 95
com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior in onMeasureChild at line 1556
androidx.coordinatorlayout.widget.CoordinatorLayout in onMeasure at line 803
android.view.View in measure at line 27131
androidx.drawerlayout.widget.DrawerLayout in onMeasure at line 1119
android.view.View in measure at line 27131
android.view.ViewGroup in measureChildWithMargins at line 7951
android.widget.FrameLayout in onMeasure at line 194
androidx.appcompat.widget.ContentFrameLayout in onMeasure at line 143
android.view.View in measure at line 27131
android.view.ViewGroup in measureChildWithMargins at line 7951
android.widget.LinearLayout in measureChildBeforeLayout at line 1552
android.widget.LinearLayout in measureVertical at line 842
android.widget.LinearLayout in onMeasure at line 721
android.view.View in measure at line 27131
android.view.ViewGroup in measureChildWithMargins at line 7951
android.widget.FrameLayout in onMeasure at line 194
android.view.View in measure at line 27131
android.view.ViewGroup in measureChildWithMargins at line 7951
android.widget.LinearLayout in measureChildBeforeLayout at line 1552
android.widget.LinearLayout in measureVertical at line 842
android.widget.LinearLayout in onMeasure at line 721
android.view.View in measure at line 27131
android.view.ViewGroup in measureChildWithMargins at line 7951
android.widget.FrameLayout in onMeasure at line 194
com.android.internal.policy.DecorView in onMeasure at line 1175
android.view.View in measure at line 27131
android.view.ViewRootImpl in performMeasure at line 4187
android.view.ViewRootImpl in measureHierarchy at line 2936
android.view.ViewRootImpl in performTraversals at line 3204
android.view.ViewRootImpl in doTraversal at line 2618
android.view.ViewRootImpl$TraversalRunnable in run at line 9971
android.view.Choreographer$CallbackRecord in run at line 1010
android.view.Choreographer in doCallbacks at line 809
android.view.Choreographer in doFrame at line 744
android.view.Choreographer$FrameDisplayEventReceiver in run at line 995
android.os.Handler in handleCallback at line 938
android.os.Handler in dispatchMessage at line 99
android.os.Looper in loop at line 246
android.app.ActivityThread in main at line 8653
java.lang.reflect.Method in invoke
com.android.internal.os.RuntimeInit$MethodAndArgsCaller in run at line 602
com.android.internal.os.ZygoteInit in main at line 1130

this bug took me one debugging day before find the problem.

this is my method that causes this issue:

@Click(R.id.btn)
public void displayDetails()
{
//OnActionListener.dislayDetails();
}

i got this error because the ony intruction in my method is commented. So my function is empty ans app crash
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant