Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <uses-permission android:name="com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY"/>
- <uses-permission android:name="android.permission.INTERNET" />
- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
- @Override
- public void onErrorResponse(VolleyError error) {
- // TODO Auto-generated method stub
- android.util.Log.e("ERROR", "ERROR " + error.toString());
- android.util.Log.e("LOCALERRORMSG", "ERROR " + error.getLocalizedMessage());
- android.util.Log.e("ERRORMSG", "ERROR " + error.getMessage());
- }
- public class CustomHeaderJsonObjectRequest extends JsonObjectRequest {
- public CustomHeaderJsonObjectRequest(int method, String url, JSONObject jsonRequest, Response.Listener<JSONObject> listener, Response.ErrorListener errorListener) {
- super(method, url, jsonRequest, listener, errorListener);
- }
- @Override
- public Map<String, String> getHeaders() throws AuthFailureError {
- Map<String, String> headers = new HashMap<>();
- headers.put("User-Agent","Mozilla/5.0");
- return headers;
- }
- @Override
- public String getBodyContentType()
- {
- return "application/json; charset=utf-8";
- }
- }
Add Comment
Please, Sign In to add comment