using web service

  • Replies:0
MahsaN
  • Forum posts: 1

Jun 14, 2017, 10:42:22 AM via Website

Hi
I am new in android programming. I want to get some info from a web service. I have to convert the String content that I got from webService to a specified class type ("AtiranResalt") and then I get a String variable of the object of this class. then I have to convert this String to another specified class ("Customer") again.

AtiranResult myAtRes = new Gson().fromJson(gContent, AtiranResult.class);
Customer myCustomers[] = new Gson().fromJson(myAtRes.Result, Customer[].class);

when I debug my program, the two objects of these two classes are created and I can watch them. but when I run my program , it crashes and the emulator show this message: " the app has stopped ". what am I doing wrong?

by the way the method in which I create the objects is called in onClick method of a button

I really need a help, thanks in advance

Reply