Android/Java: how to delay return in a method

If you execute makeJsonObjectRequest on a background thread, then you can execute synchronous Volley request this way:
Can I do a synchronous request with volley?

If you execute makeJsonObjectRequest on the UI thread, then you shouldn’t wait for onResponse to avoid blocking UI thread. Use callback in this case.

Leave a Comment