Skip to content
Advertisement

Tag: android-recyclerview

Getting error : Could not deserialize object. Failed to convert a value of type java.lang.String to long

enter image description hereI have tried changing values many times. Now I have the same values in Firebas. It’s working if I give the values manually in code, but it’s not working while I try to get the info from Firestore. But still, I’m getting this error continuously: That’s my Model’s code } My adapter code } Main Activity }

RecyclerView on a null object reference

So I was trying to show images from firebase to recyclerview, but it threw me an error. Error says E/nitecompetitiv: [qarth_debug:] get PatchStore::createDisableExceptionQarthFile method fail. E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.fortnitecompetitive, PID: 15205 java.lang.NullPointerException: Attempt to invoke virtual method ‘void androidx.recyclerview.widget.RecyclerView.setAdapter(androidx.recyclerview.widget.RecyclerView$Adapter)’ on a null object reference at com.example.fortnitecompetitive.NewsActivity$1.onDataChange(NewsActivity.java:66) at com.google.firebase.database.core.ValueEventRegistration.fireEvent(ValueEventRegistration.java:75) at com.google.firebase.database.core.view.DataEvent.fire(DataEvent.java:63) at com.google.firebase.database.core.view.EventRaiser$1.run(EventRaiser.java:55) at android.os.Handler.handleCallback(Handler.java:907) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:216)

How to pass a list of objects from one activity to another using parcelable

I want to pass the list of itemselected or ItemsInCart to another activity. My Items Model implements parcelable. The problem is am getting error below in my SecondActivity class. Caused by: java.lang.NullPointerException: Attempt to invoke virtual method ‘void androidx.recyclerview.widget.RecyclerView.setLayoutManager(androidx.recyclerview.widget.RecyclerView$LayoutManager)’ on a null object reference at com.example.Project1.SecondActivity.onCreate(SecondActivity.java:59) Below is the code Model Item; } First Activity; The list that i want

What’s simple code/effective code to create CheckBox Programmatically in BottomSheetDialog when click every item in RecyclerView in Android (Java)

I have 100+ item in RecyclerView. these days I have tried to create simple code/effective code to create Checkbox in BottomSheetDialog Programmatically but no success. My goal : Every item click in RecyclerView will show BottomSheetDialog with different amount checkbox. example : when click item[0] in RecyclerView will open BottomSheetDialog with 7 checkboxes, if click item[1] in RecyclerView will open

How to scroll one to one in recycler view?

this is my adapter I want to scroll one item each time i scroll. Like when you see multiple images post on instagram. How can i do that? Thanks and my XML; Answer You can use a SnapHelper by attaching it to your RecyclerView with SnapHalper.attachToRecyclerView() and you will have a Scroll effect like instagram for example :

Advertisement