简体   繁体   English

检测res / xml和首选项活动时出错

[英]Error with detecting res/xml and preference activity

I am trying to add a Preference activity in my andorid App, but my eclipse is not recognizing the res/xml folder and addPreferenceFromResources() method is showing as deprecated. 我试图在我的andorid应用程序中添加一个Preference活动,但是我的日食无法识别res / xml文件夹,并且addPreferenceFromResources()方法显示为已弃用。 So Please help how I can proceed further further. 因此,请帮助我进一步进行下去。 BTW I am reading the Hello Android by Ed Burnette. 顺便说一句,我正在阅读Ed Burnette的Hello Android。 This thing is mention in Chapter 3 page 54. Please help me guys. 在第3章第54页中提到了这个问题。请帮助我。

Regards Simran Preet Singh 关于Simran Preet Singh

Clean and build the project. 清理并构建项目。 Replace PreferenceActivity by using PreferenceFragment. 通过使用PreferenceFragment替换PreferenceActivity。

Check if you are importing the following in your header statements: 检查是否在标题语句中导入以下内容:

import android.R; 导入android.R;

If you are , delete it and see if you can pick up xml/prefs. 如果是,请将其删除,然后查看是否可以提取xml / prefs。

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

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