Using startActivityForResult across Android applications

后端 未结 2 913
一向
一向 2021-01-22 07:01

I have written an application that has an so that other applications can start it using startActivityForResult(). When this acti

2条回答
  •  轮回少年
    2021-01-22 07:54

    You could use a library like Jackson to serialize your object to a JSON string which you then you deserialize on the other end.

    It's much more flexible and will eliminate the problem of inconsistent versions of your data being passed around if you decide to add for instance an extra field.

    Also, the two apps no longer need to maintain a class in the same namespace or even call them by the same name.

    And as a final note, you no longer need to publish a jar, only your documentation will suffice.

提交回复
热议问题