Android SharedPreferences.Editor putStringSet method not available -


i trying update password generator made include ability save passwords, i'm using sharedpreferences. want put saved passwords inside set, when try save set using sharedpreferences.editor's putstringset method, eclipse not recognize it. when hover on putstringset in code, 2 quick fixes available "change putstring(...)" , "add cast editor", don't think either of helps.

this have:

public void save(view v) {     sharedpreferences prefs = getpreferences(mode_private);     final sharedpreferences.editor editor = prefs.edit();     savedpasswords = (set<string>) getsharedpreferences("savedpasswordslist", 0);     alertdialog.builder dialog = new alertdialog.builder(this);     dialog.setitems(passwords, new dialoginterface.onclicklistener(){         public void onclick(dialoginterface face, int num)         {             savedpasswords.add(passwords[num]);             editor.putstringset("savedpasswordslist", savedpasswords);             editor.commit();             refreshsavedpasswordslist();         }     });     dialog.show(); } 

putstringset(...) added @ api 11 (android v3.0.x onwards). guess you're targeting version below that.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -