How to wait for Volley response end before executing next lines?
问题 I'm developing an android app that reads data from API then show these data in multi-choice dialog. However, when I click the button the dialog is empty. I think that maybe the program executes the next lines of code before volley returns the response. I searched a lot but I didn't understand how to fix this, I'm a beginner in using Volley. Here is the dialog code where I get the data from API: public class LevelsDialog extends DialogFragment { ArrayList<String> list = new ArrayList<>();