简体   繁体   English

如何在共享首选项中存储意图

[英]How to store intent in sharedpreferences

So I searched up how to store Intents into sharedpreferences and I saw this post:所以我搜索了如何将 Intents 存储到 sharedpreferences 中,我看到了这篇文章:

Any workaround to save an Intent in settings? 在设置中保存 Intent 的任何解决方法?

However, the answer that was proposed in that post used deprecated methods such as但是,该帖子中提出的答案使用了已弃用的方法,例如

Intent.getIntent(String);

and

Intent.toURI();

I was wondering if there were any other ways to store Intents without using these deprecated methods.我想知道是否还有其他方法可以在不使用这些不推荐使用的方法的情况下存储 Intent。

You can use toUri(int flags) as an alternative for toURI() and getActivity().getIntent(String) as an alternative for getIntent(String) .您可以使用toUri(int flags)作为toURI()的替代方法,使用getActivity().getIntent(String)作为getIntent(String) (String) 的替代方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM