且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

关于 PreferenceActivity 的 Android 已弃用方法警告

更新时间:2022-12-08 10:38:02

由于该方法已被弃用,建议您不要在代码中使用它,因为它完全有可能在以后的版本中被删除安卓的.但是,我还没有遇到过实际上已从 Android 中删除的弃用方法.

As the method is deprecated, it is recommended that you don't use it in your code, as it is entirely possible that it can be removed in future versions of Android. However, I am yet to come across a deprecated method that has actually been removed from Android.

方法描述中没有提供替代方法,因为首选方法(从 API 级别 11 开始)是实例化 PreferenceFragment 对象从资源文件加载您的首选项.请参阅此处的示例代码:PreferenceActivity

No alternative method is provided in the method's description because the preferred approach (as of API level 11) is to instantiate PreferenceFragment objects to load your preferences from a resource file. See the sample code here: PreferenceActivity