- Forum posts: 1
Jun 14, 2017, 10:42:22 AM via Website
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
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.