Skip to content

How to get android context for starting an intent? #124

Answered by arkivanov
malliaridis asked this question in Q&A
Discussion options

You must be logged in to vote

If you just need to abstract the Android context, then instead of using the function directly, you can pass an interface into the component. Then implement this interface for each platform, on Android the implementing class should receive the context via constructor.

Another way would be to just pass a callback into the component - e.g. startOauth: () -> Unit. Then implement the callback in the activity.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@malliaridis
Comment options

@arkivanov
Comment options

@malliaridis
Comment options

Answer selected by malliaridis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants