Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm opening an Activity on fragment view touch. how to get data back to the fragment which opens the Activity.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
148 views
Welcome To Ask or Share your Answers For Others

1 Answer

1- First you'll have to start the Activity from your fragment using startActivityForResult()

2- Make sure to call super.onActivityResult in your Activity's onActivityResult() method ( if you're implementing it)

3-Inside your fragment, you just need to implement onActivityResult() and handle the result as you wish


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...