json - Compare value of JSONObject with boolean value -


i have jsonobject having key identified , value true or false(boolean). next time have check whether key true or false doing this:

jsonobject eachcasejsonobject = new jsonobject(); eachcasejsonobject.put("json_is_identified", true);

now want check value of key json_is_identified , doing :

"true".equalsignorecase(eachcasejsonobject.get(json_is_identified).tostring())

but want boolean value directly using key json_is_identified , have check true or false.

you can use:

eachcasejsonobject.getboolean("json_is_identified") 

Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -