I have a question: Is it possible to divide a very long text, which the app gets from the Internet in a Json-data, into small parts of the text? Then these parts should be shown in single cardviews.
If it's possible, can somebody show me how? I tried a very long time and didn't get it. Thanks for help!
EDIT
That's the jsonRequest and it builds the TextView.
jsonObjectRequest = new JsonObjectRequest(Request.Method.GET, "http://example.com/document.json",
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
try {
JSONArray jsonArray = response.getJSONArray("data1");
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject obj = jsonArray.getJSONObject(i);
String a = obj.getString("a");
String b = obj.getString("b");
String c = obj.getString("c");
String d = obj.getString("d");
textView.append(Html.fromHtml("<p><b>" + a + "</b><br>" + b + "<br>" + c + "<br>" + d + "</p>"));
}
} catch (JSONException e) {
e.printStackTrace();
}
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.e("VOLLEY", error.toString());
}
}
);
requestQueue.add(jsonObjectRequest);
;
Now the TextView should be divided into small parts. In every part should be the Strings a, b, c and d. And around these small parts should be a cardview.