开发者

Question regarding SDK object / method call: public abstract SharedPreferences.Editor putString (String key, String value)

开发者 https://www.devze.com 2023-02-15 14:29 出处:网络
When I try to use this in Eclipse (3.6) I get: The method putStringSet(String, HashSet) is undefined for the type SharedPreferences.Editor

When I try to use this in Eclipse (3.6) I get: The method putStringSet(String, HashSet) is undefined for the type SharedPreferences.Editor

If I cast the HashSet to a Set I get this: The method putStringSet(String, Set) is undefined for the type SharedPreferences.Editor

However it's clearly defined in the documentation. http://developer.android.com/reference开发者_开发技巧/android/content/SharedPreferences.Editor.html#putStringSet%28java.lang.String,%20java.util.Set%3Cjava.lang.String%3E%29

The documentation says "Since API Level 1"

And the 'Quick Fixes' offered aren't helpful.

I don't think I'm missing any imports but that could make sense too...

I freely admit that I'm not up to speed on Java or Eclipse, so there's good odds I'm missing something obvious...

Anyone care to point out the obvious?

Thank you.

Gary Lucas


You aren't missing anything, it's not there. I'm not sure why it shows up in the reference. Here is the source for SharedPreferences.java, putStringSet is definitely not in the Editor interface


Most of the class is definitely api level 1, but putStringSet is actually api level 11.

0

精彩评论

暂无评论...
验证码 换一张
取 消