score:1
Accepted answer
insted of adding List i have added JsonArray and i have converted to my my list of object type using Gson.it is working fine
new Response.Listener<JsonArray>() {
@Override
public void onResponse(JsonArray json) {
Gson gson=new Gson();
TypeToken<List<Vehicle>> token = new TypeToken<List<Vehicle>>(){};
List<Vehicle> personList = gson.fromJson(json, token.getType());
Log.d("TAG","ReLs:: "+personList.get(0).getVehicleType());
Toast.makeText(getApplicationContext(),personList.get(0).getVehicleType(), Toast.LENGTH_SHORT).show();
}
}
Source: stackoverflow.com
Related Query
- how get response as list of custom object using volley in android
- ContentCachingResponseWrapper : How to get application response object (not httpResponse) using ContentCachingResponseWrapper
- how to get the element of a list inside jsp using JSTL?
- How to get response in JSON format using @ExceptionHandler in Spring MVC
- how to add success/error flag while returning list of object as a response
- how we can bind a list of a list of object using thymeleaf
- How to pass list parameters for each object using Spring MVC?
- How to sort a list of objects from a parent object using a for loop Spring Mvc
- How to access custom Java object sent as response in AJAX request, in JavaScript?
- How to bind an object to a form (th:object) using th:each for a list of objects with Thymleaf
- How to iterate a List in a Map of String and List of object using JSTL?
- How to get element of list FROM JSP using JSTL and spring 3
- How to get a PageRequest object sent across in a unit test using Spring RestOperations?
- How to produce json response that consumes json object using spring and Hibernate
- How to test spring's @RequestBody which recieves custom object using MockMvc
- How to initialize List inside Object using Spring Annotation
- How to get the pojo class object say Employee in controller class using spring 4 annotation
- How to get the time from a list of objects and set it to "time ago" using JodaTime and Spring MVC
- how get list of Object foreign key in Spring when use ManyToMany relation?
- How to get request header value from http request in spring mvc using custom annotaion?
- Spring MVC and Thymeleaf: How to get the value of an object of a list after an iteration
- Sending request to Spring framework(MVC) using Get method in volley in Android
- How do you return the response object from ModelAndView when you are using spring forward to redirect to a different controller?
- How To get String Response using spring controller in ajax and base of that perform action?
- How to get object instead of string from dropdown list in Spring MVC
- How to get json data response from Controller to JQueryAjax using Spring?
- How can i set custom response phrase using Spring framework?
- How to convert Java custom object list to JSON array?
- How to return a custom object from a Spring Data JPA GROUP BY query
- How do I get the Session Object in Spring?
More Query from same tag
- Spring Web Flow 2.5.1.RELEASE with JSF2.2 flow not executed
- spring mvc and ajax get 400 error
- Spring IT test fails
- Form validation errors are not displayed in JSP page using Spring 3.1
- cannot be found on object of type 'java.util.LinkedHashMap' - maybe not public?
- Spring controller get request/response
- I am trying Spring MVC and when I add @Autowired in my controller class I get following error:
- What is the correct base for relative URLs in Spring MVC application?
- Uploading Webapp to CloudBees
- How to handle validation and critical errors in Spring MVC
- Using Model as GenericDAO
- Should each module in a Maven project have its own Spring application context?
- How to retrieve FORM/POST Parameters in Spring Controller?
- how to select a user id and merge the updated user inputs in respective fields
- Spring Async issue when upgrading from 4.2.0.RC3 to 4.2.0.RELEASE
- spring mvc 3 + jquery + AJAX + $.get - value not returned from controller to callback method
- Bean Required for Spring MVC xml file for Amazon S3
- No HandlerMappings found in servlet 'DispatcherServlet': using default
- JNDI Session Factory Error with Tomcat and Hibernate
- Spring Security logout does not work - does not clear security context and authenticated user still exists
- I am getting a HTTP Status 500 - Servlet.init() for servlet HelloWorld threw exception
- use stormpath group as spring boot object
- Spring - form with 2 buttons sending to 2 different controllers
- Most Efficient way to convert jdbctemple result to json?
- Spring Web-mvc not working with Spring Boot[Spring cloud]
- Spring bean getting initialised twice in java configuration
- No qualifying bean found for dependency Error
- How to use same instance of ClassPathXmlApplicationContext in whole App?
- CrudRepository does not delete an Object with relationship
- Spring boot REST controller POST request handling