我有一个需要修改 SharedPreferences 的活动。
public class AddingEmail extends ListActivity implements OnClickListener{
private String newMail;
private SharedPreferences prefs;
private PreferenceManager prefMan;
private EditText emailAdd;
private EditText emailDel;
private ArrayList<String> prefList;
@Override
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.addingemail);
Log.d("On Addig EMAIL ACTIVITY","on Create");
String name = "com.example.daemon3_preferences";
prefs = this.getSharedPreferences(name, MODE_PRIVATE);
这是 PreferenceScreen ..
public class PreferencesScreen extends PreferenceFragment{
private final String TAG = "PreferencesScreen";
private Set<String> emails;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.d(TAG, "OnCreate");
addPreferencesFromResource(R.xml.prefs);
我有这个错误:
java.lang.IllegalArgumentException:文件 /data/data/com.example.daemon3/shared_prefs/com.example.daemon3_preferences.xml.xml 包含路径分隔符
为什么需要 .xml.xml 而不是 .xml?