Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClientError - Can't import #7

Open
loirotv opened this issue Jul 18, 2017 · 0 comments
Open

ClientError - Can't import #7

loirotv opened this issue Jul 18, 2017 · 0 comments

Comments

@loirotv
Copy link

loirotv commented Jul 18, 2017

Hey there!

I've been trying to adapt your code to my own project, but I'm stucked with this problem.
(JSONObjectResponseActivity.java)

`jsonObjRequest = new JsonObjectRequest(Request.Method.GET, builder.toString(), null, new Response.Listener() {
@OverRide
public void onResponse(JSONObject response) {
try {
parseFlickrImageResponse(response);
mAdapter.notifyDataSetChanged();
} catch (Exception e) {
e.printStackTrace();
showToast("JSON parse error");
}
stopProgress();
}
}, new Response.ErrorListener() {

		@Override
		public void onErrorResponse(VolleyError error) {
			// Handle your error types accordingly.For Timeout & No connection error, you can show 'retry' button.
			// For AuthFailure, you can re login with user credentials.
			// For ClientError, 400 & 401, Errors happening on client side when sending api request.
			// In this case you can check how client is forming the api and debug accordingly.
			// For ServerError 5xx, you can do retry or handle accordingly.
			if( error instanceof NetworkError) {
			} else if( error instanceof ClientError) {
			} else if( error instanceof ServerError) {
			} else if( error instanceof AuthFailureError) {
			} else if( error instanceof ParseError) {
			} else if( error instanceof NoConnectionError) {
			} else if( error instanceof TimeoutError) {
			}

			stopProgress();
			showToast(error.getMessage());
		}
	});`

In this part of the code, ClientError cannot be resolved.

I've tried to import volley in several ways (.jar, compile 'com.android.volley:volley:1.0.0', compile 'com.mcxiaoke.volley:library:1.0.19', etc) but none of them can resolve import com.android.volley.ClientError;

I'd really appreciate any help you could give me.

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant