You mean this one ? Yeah, i wrote like this , ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, android.R.id.text1,str1);
ListView lv.setAdapter(adapter); On Sat, Aug 4, 2012 at 10:46 AM, HideCheck <hidech...@gmail.com> wrote: > I guess as follows. > > 1. Argment is empty. > JSONArray jsonArray=json1.getJSONArray(""); > > 2. Did you write this? > ListView#setAdapter(adapter) > > > Best Regards > > 2012/8/4 Meena Rengarajan <meenasoft...@gmail.com>: > > This is my code. Listview using Json in Android . But my lists is not > > displaying when i click a button.. Only displaying first activity alone. > > Whats wrong here ? can anyone help me .. > > try { > > JSONObject json1=new JSONObject(resultJSON); > > JSONArray jsonArray=json1.getJSONArray(""); > > int length = jsonArray.length(); > > System.out.println("json1:"+json1); > > System.out.println("jsonarray:"+jsonArray); > > String[] str1 = new String[length]; > > for (int i = 0; i < str1.length; i++) { > > > str1[i]=jsonArray.getJSONObject(i).getJSONObject("FORM").getJSONArray("FPROP".getJSONObject(0).getString("FNAME"); > > > > } > > } catch (Exception e) { > > // TODO: handle exception > > Toast.makeText(NewActivity.this,"sorry", Toast.LENGTH_LONG).show(); > > } > > ArrayAdapter<String> adapter = new > > ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, > > android.R.id.text1,str1); > > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to android-developers@googlegroups.com > > To unsubscribe from this group, send email to > > android-developers+unsubscr...@googlegroups.com > > For more options, visit this group at > > http://groups.google.com/group/android-developers?hl=en > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to android-developers@googlegroups.com > To unsubscribe from this group, send email to > android-developers+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en