javaandroidjsonkeysetmissingmethod

JSONObject keySet() function not there?


Very confused. New project, add this code:

import org.json.JSONObject;

JSONObject jsonObject = new JSONObject();
jsonObject.keys();
jsonObject.keySet();

.keys() method resolves as it should.

.keySet() method highlights red with AndroidStudio giving "Cannot resolve method keyset()" error.

If i go to keys() definition, here they both are public and all: http://goloskok.com/u/2015-07-01_16-41-08.jpg

What am I doing wrong?


Solution

  • See the @hide annotation

    * @hide.
      */
            public Set<String> keySet() {
                return nameValuePairs.keySet();
            }