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

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

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

asp.net mvc - breakpoint on javascript in CSHTML? -