Sto cercando di leggere SharedPreferences all'interno di Fragment. Il mio codice è quello che uso per ottenere le preferenze in qualsiasi altra attività.SharedPreferences Android in Fragment
SharedPreferences preferences = getSharedPreferences("pref", 0);
ottengo errore
Cannot make a static reference to the non-static method getSharedPreferences(String, int) from the type ContextWrapper
ho cercato di seguire questi link, ma senza fortuna Accessing SharedPreferences through static methods e Static SharedPreferences. Grazie per qualsiasi soluzione.
getSharedPreferences ("pref", 0); zero (0) significa che privato/pubblico? – Kailas
@Kailas corretti, la modalità, ad esempio WORLD_READABLE ect. http://developer.android.com/reference/android/content/Context.html#getSharedPreferences(java.lang.String, int) – Jug6ernaut
quale tipo di modalità ho utilizzato le preferenze condivise solo l'accesso da tale applicazione nessuna altra applicazione leggi/scrivi i valori delle preferenze condivise? – Kailas