Issue
I'm beginner in Android development. I'm creating an application in Kotlin and met some problem. I wanted to show another activity and get the selected data from it to the fragment but I could not find how to do that...
Language: Kotlin Problem: Is it possible to do as shown on picture A? If yes, may I get some advice of how to show Activity2 from Fragment1 of MainActivity and get the items to the fragment1 when clicking "Select" button of Activity2?
- Want to show Activity2 from Fragment1(MainActivity)
- Want to get the selected items from Activity2 to Fragment1
Solution
If I understood your question correctly, it seems like what you want to do can be achieved with startActivityForResult()
but it will be soon deprecated.
So I would suggest to use ActivityResultLauncher
.
You can read more about it here OnActivityResult method is deprecated, what is the alternative?
Answered By - Void
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.