java - How to parse json array in android with no name? -


how can parse json array in android looking like:

["bhubaneswar","bangalore cant","brahmapur","visakhapatnam", "vijayawada road","asokhar","chaurakheri","banihal","sadura","anantnag", "panjgam","awantipura","kakapora","pampore"] 

what trying is:

     try {             jsonobject json = new jsonobject(s);              jsonarray jsonarray = json.names();              ( int = 0 ; < jsonarray.length();i++)             {                 toast.maketext(getapplicationcontext(),jsonarray.getint(i),toast.length_long).show();             }          } catch (jsonexception e) {             e.printstacktrace();         } 

but not getting output.

try this...

try {         jsonarray jsonarray = new jsonarray(s);          ( int = 0 ; < jsonarray.length();i++) {              toast.maketext(getapplicationcontext(),jsonarray.getstring(i),toast.length_long).show();          }  } catch (jsonexception e) {      e.printstacktrace(); } 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -