how to know how many shared preference in shared preferences in android -


i want know how many shared preference in shared preferences found in file explorer coding , there method return total number of shared preferences ?

enter image description here

to number of entries can use

sharedpreferencesinstance.getall().size()  

to retrieve keys stored can use keyset(), shown in following snippet:

sharedpreferences prefs = this.getsharedpreferences("myshared", context.mode_private); map<string,?> entries = prefs.getall(); set<string> keys = entries.keyset(); (string key : keys) {  } 

Comments

Popular posts from this blog

php - Passing multiple values in a url using checkbox -

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -