0

Error is................................................................. Java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference at com.ABC.Fragment.NotificationFragment$2.onClick(NotificationFragment.java:192) ..........................................................................

This is clickble on edit textview...

edit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                clicktype="clicktypeFromEdit";
                edit.setVisibility(View.GONE);
               done.setVisibility(View.VISIBLE);
                list_of_noti_pos.clear();
                list_of_noti_id.clear();
          
                for (int i = 0; i < notificationTypeList.size(); i++) {
                   //View v = notification_recyclerView.getLayoutManager().findViewByPosition(i);
                   View v = notification_recyclerView.getChildAt(i);
                    CheckBox cb = v.findViewById(R.id.checkbox);
                    LinearLayout ll_chk = v.findViewById(R.id.ll_chckbox);
                    ll_chk.setVisibility(View.VISIBLE);
                    cb.setVisibility(View.VISIBLE);
                    cb.setChecked(false);
                }
sumeet raj
  • 11
  • 4
  • Can you post the crash's stack trace? – Sơn Phan Oct 23 '20 at 10:17
  • Please check... java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference at com.ABC.Fragment.NotificationFragment$2.onClick(NotificationFragment.java:192) – sumeet raj Oct 23 '20 at 13:02

0 Answers0