Skip to content

Conversation

@Luna712
Copy link
Contributor

@Luna712 Luna712 commented Oct 23, 2025

I've mentioned to extension developers already, but it's probably good to follow here as well.

Rather than using context to get the activity outside of the callback, We have to use the version provided to the callback. Otherwise when there is an activity state change the context is outdated and the settings dialog won't open, or in some cases cause the app to crash with an exception.

I've mentioned to extension developers already, but it's probably good to follow here as well.

Rather than using context to get the activity outside of the callback, We have to use the version provided to the callback. Otherwise when there is an activity state change the context is outdated and the settings dialog won't open, or in some cases cause the app to crash with an exception.

openSettings = {
openSettings = { ctx ->
val activity = ctx as AppCompatActivity

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a a cast that might fail if we change how context is passed. Please use as?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't think it was possible to fail for 2 reasons.

  1. It's passed as requireContext not to great but doesn't matter because...
  2. it catches any Throwable so it would handle bad context or failed casting automatically

I mean I can use a check like that but just didn't think we needed to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants