How to return a result through multiple activities

前端 未结 4 1667
南方客
南方客 2020-12-12 13:59

in some part of my application there is a structure of activities like this:

\"enter<

4条回答
  •  抹茶落季
    2020-12-12 14:28

    You might like to make use of the intent flag FLAG_ACTIVITY_FORWARD_RESULT as described in Intent when starting activities B and C

    public static final int FLAG_ACTIVITY_FORWARD_RESULT

    Since: API Level 1

    If set and this intent is being used to launch a new activity from an existing one, then the reply target of the existing activity will be transfered to the new activity. This way the new activity can call setResult(int) and have that result sent back to the reply target of the original activity.

    That way A should pick up any data sent back in the extras sent back from D

提交回复
热议问题