• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Changing 1 value of an arrays makes the other values null

Resolved: Changing 1 value of an arrays makes the other values null

0
By Isaac Tonny on 18/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I have multiple edit text in a recycler view which is placed inside another recycler view. When I change the text of that recycler view, I send the interface event to the parent recycler view. This is how the interface callback looks:
But I get a weird issue. Whenever I change the value of 1 edit text, the other values go to null. So, I tried checking the old and new arrays which I created and then got this in my log:
How can I prevent this?

Answer:

It’s because you’re doing this
So you’re basically clearing everything to null, trying to copy your text back to your null objects (which you can’t, they’re gone) and then adding one new item back in.
Honestly I’m not sure why you’re doing this? Why do you need to copy the original data, wipe it, then copy it back again? Can’t you just do something like this?

If you have better answer, please add a comment about this, thank you!

android arrays kotlin
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Time Complexity: Find the number of people who know a secret leetcode 2327

24/03/2023

Resolved: Best way to create 3d matrix of variables in PULP

24/03/2023

Resolved: Openlayers: Update clusters depending on filter (geometryFunction)

24/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.