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.

dropInClient.launchDropInForResult allow Fragments or better registerForActivityResult

See original GitHub issue

General information

  • SDK/Library version: 6.0.0.
  • Environment: sandbox
  • Android Version and Device: any

Issue description

dropInClient.launchDropInForResult() requires Activity. But in this case startActivityForResult is called on activity, not in attached fragment. So result is returned to activity and not into active fragment.

Expected behavior

launchDropInForResult accept Fragments, so we can expect result in Fragment and not only in activity.

Or even better accept Activity Result APIs lambda function to handle result in callback through registerForActivityResult. More info about Activity Result APIs:

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

mattwyldercommented, May 25, 2022

Thanks for your patience everyone, this has been released in 6.1.0!

sshropshirecommented, Jul 19, 2022

@fabiorbap apologies for this! We had a slight oversight. I’ve created a draft PR with the missing method.

It’s worth mentioning that if DropInClient is instantiated with either a Fragment or Activity and a listener is set, launchDropInForResult(null, 0) will work in the meantime.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use registerForActivityResult correctly? Getting ...
Then use that activityLauncher variable to launch it from the button click listener. For more information, see the official guide.
Read more >
Getting a result from an activity - Android Developers
registerForActivityResult() is safe to call before your fragment or activity is created, allowing it to be used directly when declaring member ...
Read more >
StartActivityForResult is deprecated - Medium
I have found the registerForActivityResult useful and clean. Some of the pros, in my opinion, are: Improve the code readability, no need to...
Read more >
Activity Result API: The Clean Way | by Prateek Batra
Why new Activity Result is better? ... launcher = registerForActivityResult ... Note: You must call registerForActivityResult() before the fragment or ...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found