Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new Response.Listener<String>() {
- @Override
- public void onResponse(String response) {
- //Do Something with the data
- try {
- JSONObject jsonObject = new JSONObject(response);
- JSONArray jsonArray = jsonObject.getJSONArray("json");
- for (int i = 0; i < jsonArray.length(); i++) {
- JSONObject questionSet = jsonArray.getJSONObject(i);
- Questions[i] = questionSet.getString("Question");
- Questions[i].replaceAll("$$","\\");
- Answer1[i] = questionSet.getString("Option1");
- Answer1[i].replace('$','\');
- Answer2[i] = questionSet.getString("Option2");
- Answer2[i].replace('$','\');
- Answer3[i] = questionSet.getString("Option3");
- Answer3[i].replace('$','\');
- Answer4[i] = questionSet.getString("Option4");
- Answer4[i].replace('$','\');
- Correct[i] = questionSet.getString("Correct");
- Toast.makeText(getApplicationContext(),Questions[i]+Answer1[i],Toast.LENGTH_SHORT).show();
- }
- setFirstTabsData();
- }catch (JSONException e){
- e.printStackTrace();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement