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("FPRO P".getJSONObject(0).getString("FNAME");
> 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("FPRO P".getJSONObject(0).getString("FNAME");
> --
> 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+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
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++) {
> > --
> > 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+unsubscribe@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+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
On Saturday, August 4, 2012 10:36:18 AM UTC+5:30, Meena Rengarajan wrote:
> 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++) {
My debugging point is not going from this line
JSONArray jsonArray=jsonObj.getJSONArray(""); but exception is caught in
Catch in this code..
JSONArray jsonArray=jsonObj.getJSONArray("");
int length = jsonArray.length();
System.out.println("jsonObj:"+jsonObj);
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("FPRO P").getJSONObject(0).getString("FNAME");
}
On Sat, Aug 4, 2012 at 11:22 AM, Meena Rengarajan <meenasoft...@gmail.com>wrote:
> On Saturday, August 4, 2012 10:36:18 AM UTC+5:30, Meena Rengarajan wrote:
>> 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");
>> --
> 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+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>> On Saturday, August 4, 2012 10:36:18 AM UTC+5:30, Meena Rengarajan wrote:
>>> 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++) {
>> --
>> 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+unsubscribe@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+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
On Saturday, August 4, 2012 10:36:18 AM UTC+5:30, Meena Rengarajan wrote:
> 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++) {
> How do i wanna split a string into two parts here by omitting first
> character ?
> On Saturday, August 4, 2012 10:36:18 AM UTC+5:30, Meena Rengarajan wrote:
>> 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");
>> --
> 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+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
> On Sat, Aug 4, 2012 at 12:47 PM, Meena Rengarajan <meenasoft...@gmail.com>
> wrote:
>> How do i wanna split a string into two parts here by omitting first
>> character ?
>> On Saturday, August 4, 2012 10:36:18 AM UTC+5:30, Meena Rengarajan wrote:
>>> 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++) {
>> --
>> 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+unsubscribe@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+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
On Sat, Aug 4, 2012 at 1:21 PM, HideCheck <hidech...@gmail.com> wrote:
> I guess
> Show of ListView rather than wrong, You have failed to parse JSON.
> > ArrayAdapter<String> adapter = new
> > ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,
> > android.R.id.text1,str1);
> > lv.setAdapter(adapter);
> this code is correct.
> Structure of the JSON is?
> 2012/8/4 Meena Rengarajan <meenasoft...@gmail.com>:
> > How should i use Array adapter here to get listview values .. I am very
> new
> > to Android can anyone help me please..
> > On Sat, Aug 4, 2012 at 12:47 PM, Meena Rengarajan <
> meenasoft...@gmail.com>
> > wrote:
> >> How do i wanna split a string into two parts here by omitting first
> >> character ?
> >> On Saturday, August 4, 2012 10:36:18 AM UTC+5:30, Meena Rengarajan
> wrote:
> >>> 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++) {
> >> --
> >> 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+unsubscribe@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+unsubscribe@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+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
But i need to knw one thing, if i use Array adapter before assigning the
values of str[i] its displaying listview also if i set adapter after
assigning values to Str[i] also dispalying listview . Why so ?
> Yeah , exactly what you have said is right . Now works on well ! I havent
> parsed JSON. I am new to this topic. Anywys thankyou :)
> On Sat, Aug 4, 2012 at 1:21 PM, HideCheck <hidech...@gmail.com> wrote:
>> I guess
>> Show of ListView rather than wrong, You have failed to parse JSON.
>> > ArrayAdapter<String> adapter = new
>> > ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,
>> > android.R.id.text1,str1);
>> > lv.setAdapter(adapter);
>> this code is correct.
>> Structure of the JSON is?
>> 2012/8/4 Meena Rengarajan <meenasoft...@gmail.com>:
>> > How should i use Array adapter here to get listview values .. I am very
>> new
>> > to Android can anyone help me please..
>> > On Sat, Aug 4, 2012 at 12:47 PM, Meena Rengarajan <
>> meenasoft...@gmail.com>
>> > wrote:
>> >> How do i wanna split a string into two parts here by omitting first
>> >> character ?
>> >> On Saturday, August 4, 2012 10:36:18 AM UTC+5:30, Meena Rengarajan
>> wrote:
>> >>> 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++) {
>> >> --
>> >> 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+unsubscribe@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+unsubscribe@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+unsubscribe@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en