मैं एक और एप्लिकेशन के माध्यम से एक अनुप्रयोग के SharedPreferences
संपादित करने के लिए कोशिश कर रहा हूँ नहीं बना सका, मेरे कोड इसएंड्रॉयड: SharedPreferences के लिए निर्देशिका फ़ाइल
try {
Context plutoContext = getApplicationContext().createPackageContext("me.test",Context.MODE_WORLD_WRITEABLE);
SharedPreferences plutoPreferences = PreferenceManager.getDefaultSharedPreferences(plutoContext);
Editor plutoPrefEditor = plutoPreferences.edit();
plutoPrefEditor.putString("country", "India");
plutoPrefEditor.commit();
}
की तरह चला जाता है मैं एक त्रुटि
E/SharedPreferencesImpl( 304): Couldn't create directory for SharedPreferences file /data/data/me.test/shared_prefs/me.test_preferences.xml
जहां me.test
मेरी अन्य परियोजना है ..te proj मैं SharedPreferences
को बिना दर्द के
मैं नेक्सस एस एंड्रॉयड 4.0.4 (Samsung) पर यह परीक्षण कर रहा हूँ, किसी भी एक मदद कर सकते हैं मुझे
आपकी "me.test" प्रोजेक्ट ने 'MODE_WORLD_WRITEABLE' के साथ साझा किए गए संदर्भ बनाए हैं? – WarrenFaith
@ वॉरेनफाइथ, टिप्पणी के लिए धन्यवाद। मैं नहीं जानता कि 'MODE_WORLD_WRITEABLE' कैसे बनाएं, मैंने अभी सामान्य –
बनाया है क्या आप अपवाद भी लिख सकते हैं? – teoREtik