I got stuck looking for the method to add a "header" on my recyclerview template. Looks like I need to use "TabLayout" over RecyclerView. But I'm not an expert in Android to see how to do it.
at the moment I have the method to get my array from JSON and drawing it with recyclerview. I used a guide to get it.
private void getGestores(String lgestoresurl) {
// Toast.makeText(getApplicationContext(), lgestoresurl, Toast.LENGTH_LONG).show();
StringRequest rq = new StringRequest(Request.Method.GET, lgestoresurl, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
try {
JSONObject jsonObject = new JSONObject(response);
JSONArray array = jsonObject.getJSONArray("result");
for (int i = 0; i < array.length(); i++) {
JSONObject ob = array.getJSONObject(i);
List_Gestores lgest = new List_Gestores(
ob.getString("car"),
ob.getString("usu"),
ob.getString("usu"),
ob.getString("Per01"),
ob.getString("Per02"),
ob.getString("Per03"),
ob.getString("Per04"),
ob.getString("Prom"));
list_gestores.add(lgest);
}
rv_lgestores.setAdapter(lgadapter);
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
});
RequestQueue requestQueue = Volley.newRequestQueue(this);
requestQueue.add(rq);
}
But my layout only shows the list but not a header like datatable.