Save intent in shared preference

前端 未结 2 1636
予麋鹿
予麋鹿 2021-01-14 00:19

I have an application from which i can launch other apps installed on my phone, with a long click i get the app picker, in result i receive an intent data, how can i save it

2条回答
  •  天涯浪人
    2021-01-14 00:33

    You could serialize the object to a string, and save the resulting string in the preferences. An easy way would be to serialize it in json format, using Google Gson for example.

提交回复
热议问题