question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hey there,

I found a Drag&Drop bug. I reinstantiate my adapter instance every time in the onResume() method. The views, in particular the RecyclerView, does not get reinstantiated. When I start the fragment for the first time Drag&Drop works great, but when I minimize and afterwards maximize the app again (staying on the same fragment) Drag&Drop doesn’t work anymore.

This seems to be because mAdapter.setLongPressDragEnabled(true); will be called twice with the same RecyclerView. But as this is a complete new Adapter instance the call should not behave in another way than before.

Greets, djuelg

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
davideascommented, Oct 3, 2017

@djuelg, when I use addToBackStack and going back I see the old fragment on the transparent background. I am not sure now, but BackStack could be useful when screen is divided with more fragments, so when you press back the fragments change and the others remain visible. That’s why I don’t add the fragments to backstack. Or maybe I should call popBackStack with some if.

However, I’m glad you found a solution! 👍 If don’t need more help on this, you can close this issue.

1reaction
djuelgcommented, Oct 1, 2017

Well I just managed to get it working somehow.

  • on first creation the adapter will be instantiated
  • on minimize/maximize the dataset will be updated
  • on fragment replace the adapter will be set to null in onDestroyView() callback (wihtout this the RecyclerView would be empty on coming back via popBackStack()
Read more comments on GitHub >

github_iconTop Results From Across the Web

DragDrop inside Popper Bug - material ui - Stack Overflow
DragDrop inside Popper Bug ... I have this Drag and Drop menu that loads when user clicks the menu icon. Then they select...
Read more >
[ Bug]: Drag drop is not working · Issue #8022 - GitHub
Element dragging is successful in my case but dropping is not getting success. What is your expected behavior? Drag and drop should happen ......
Read more >
Fix problem: Drag and drop not working in Windows
Drag and drop is no longer working in Windows 10 or Windows 11? Here's how to fix this problem in just a couple...
Read more >
Drag and Drop Bug in Selenium and Selenium Tools Package
Drag and drop is a gesture in which the user selects a virtual object by grabbing it and dragging it to a different...
Read more >
possible bug with drag and drop - AppleVis
possible bug with drag and drop. By Troy, 16 February, 2022. Forum. iOS and iPadOS. Has anyone else discovered this issue with drag...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found