Searchview with Recyclerview in Android using Volley per pagin How to add search filters to the last page in a recycler view that consumes ten page?

I am doing a search filter by identity document in a Recyclerview that is per page, the problem is that at the time of making the filter it only looks for the first diez that is the current page. How would I filter the search from the current page until last page?

RecyclerActasAdapter.java

  @Override
    public int getItemCount() {
        return this.itemsMostrados.size();
    }

    public void filtrar(String query) {
        this.itemsMostrados = new ArrayList<>();

        if (query.length() == 0) {
            itemsMostrados = listaActas;
            layoutResultados.setVisibility(View.GONE);
        } else {
            ActasActivity actas= new ActasActivity();
            for (Datum data: listaActas) {
                if (data.getBeneficiario().getNumDocumento().contains(query)
                    //|| (data.getBeneficiario().getNombre().toLowerCase() + " " + data.getBeneficiario().getApellido().toLowerCase()).contains(text.toLowerCase())
                    || (data.getBeneficiario() != null ? data.getBeneficiario().getNombre() : "No registra" + " " + data.getBeneficiario() != null ? data.getBeneficiario().getApellido() : "No registra").contains(query)
                    //|| data.getPoblacion().getNombre().toLowerCase().contains(text.toLowerCase())
                    //|| data.getMunicipio().getMunicipio().toLowerCase().contains(text.toLowerCase())
                    ) {
                    itemsMostrados.add(data);

                }
            }

            layoutResultados.setVisibility(View.VISIBLE);
            txtResults.setText(itemsMostrados.size() + "");

        }

        notifyDataSetChanged();
    }

    public void actualizar() {
        itemsMostrados = listaActas;
        notifyDataSetChanged();
    }


ActasActivity.java

In this activity I try to create the condition to filter search to the last page but still continue to filter only the first 10 of the current page

  public void obtenerActas(boolean inicializar) {

        if (inicializar) {
            current_page = 1;
            last_page = 1;
            last_size_pages = 0;
        }

        final Promise<RespuestaActasDTO, BusinessException, RespuestaActasDTO> mPromise = actasService.obtenerActas(current_page);
        mPromise.done(result -> {
            if (progressDialog.isShowing()) {
                progressDialog.dismiss();
            }

            actualizarListadoActas(result, inicializar);

            if (progressBar.getVisibility() == View.VISIBLE) {
                progressBar.setVisibility(View.GONE);
            }

        });
        mPromise.fail(error -> {
            if (progressDialog.isShowing()) {
                progressDialog.dismiss();
            }

            if (progressBar.getVisibility() == View.VISIBLE) {
                progressBar.setVisibility(View.GONE);
            }

            Toast.makeText(mContexto, "Ocurrió un error consultando las actas", Toast.LENGTH_SHORT).show();
        });
    }

    public void actualizarListadoActas(RespuestaActasDTO respuestaActasDTO, boolean inicializar) {

        // logica para controlar la pagina a consumir y saber cual es la ultima pagina
        last_page = respuestaActasDTO.getLastPage();

        //SI PAGINA ACTUAL ES MENOR QUE ULTIMA PAGINA
        if (current_page < last_page) {
            current_page++;//ENUMEREME DESDE LA PAGINA ACTUAL

        }

        if (actasAdapter == null || inicializar) {
            listaActas = new ArrayList<>();
            listaActas = respuestaActasDTO.getData();

            actasAdapter = new RecyclerActasAdapter(mContexto, listaActas, layoutResultados, txtResults);
            recyclerViewActas.setAdapter(actasAdapter);
            scrollListener.resetState();
        } else {
            //página actual <   última página
            if (current_page < last_page) {
                listaActas.addAll(respuestaActasDTO.getData());
                actasAdapter.actualizar();

                agregarUltimaConsulta = true;
            } else if (current_page == last_page) {
                if (agregarUltimaConsulta) {
                    agregarUltimaConsulta = false;
                    last_size_pages = respuestaActasDTO.getData().size();
                    ultimaLista = respuestaActasDTO.getData();

                    listaActas.addAll(ultimaLista);
                    actasAdapter.actualizar();
                } else if (last_size_pages != respuestaActasDTO.getData().size()) {
                    // limpiar ultimos registros para volverlos a agregar

                    ultimaLista = respuestaActasDTO.getData();
                    last_size_pages = respuestaActasDTO.getData().size();

                    listaActas.addAll(ultimaLista);
                    actasAdapter.actualizar();
                }
            }
        }
        // Logical END to control the page to consume and know which is the last page ------>>>>


        if (agregarEventoBuscar) {
            agregarEventoBuscar = false;
            // buscador
            inputBuscar.setOnQueryTextListener( new SearchView.OnQueryTextListener() {
                @Override
                public boolean onQueryTextSubmit(String query) {
                    actasAdapter.filtrar(inputBuscar.getQuery().toString() );
                    return true;
                }

                @Override
                public boolean onQueryTextChange(String newText) {
                    return false;
                }
            } );

        }


Observation: I only filter the query if I scroll to the last page, Thanks for your support

android studio – Recycler view in fragment with bottom navigation view

Help, I have a bottom navigation view and am trying to inflate a view with a recycle view in my fragment (CourseFragment). Every time I try, I get a pointerExcepcition. I am already checking my fragment_course.xml and there is no problem that I notice there or in my activity (CourseFragment). or in my activity that controls navigation (MainActivity), the attached photo of CourseFragment, fragment_course.xml and the error that is shown in the logcat.
If anyone wants to help me, I would appreciate it.

Fragment of course

fragment_curso.xml

Logcat error

android studio – Recycler view problems – 100% on AVD, which leads to CRASH when executed on SMARTPHONE;

Guys, I'm new here, I have an app that I'm developing based on a course. The problem is that she has one Recycler view If the app runs on the AVD, it works 100%. However, when I run it on my smartphone, the app crashes. I'm really looking for help since I've tried all kinds of things.

ACTIVITY CODE CALLING UP THE RECYCLER

public class RequisicoesActivity extends AppCompatActivity {

//Componentes
private RecyclerView recyclerRequisicoes;
private TextView textResultado;

private FirebaseAuth autenticacao;
private DatabaseReference firebaseRef;
private List listaRequisicoes = new ArrayList<>();
private RequisicoesAdapter adapter;
private Usuario motorista;

private LocationManager locationManager;
private LocationListener locationListener;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_requisicoes);

    inicializarComponentes();

    //Recuperar localizacao do usuário
    recuperarLocalizacaoUsuario();

}

@Override
protected void onStart() {
    super.onStart();
    verificaStatusRequisicao();
}

private void verificaStatusRequisicao(){

    Usuario usuarioLogado = UsuarioFirebase.getDadosUsuarioLogado();
    DatabaseReference firebaseRef = ConfiguracaoFirebase.getFirebaseDatabase();

    DatabaseReference requisicoes = firebaseRef.child("requisicoes");

    Query requisicoesPesquisa = requisicoes.orderByChild("motorista/id")
            .equalTo( usuarioLogado.getId() );

    requisicoesPesquisa.addListenerForSingleValueEvent(new ValueEventListener() {
        @Override
        public void onDataChange(DataSnapshot dataSnapshot) {
            for( DataSnapshot ds: dataSnapshot.getChildren() ){

                Requisicao requisicao = ds.getValue( Requisicao.class );

                if( requisicao.getStatus().equals(Requisicao.STATUS_A_CAMINHO)
                        || requisicao.getStatus().equals(Requisicao.STATUS_VIAGEM)
                        || requisicao.getStatus().equals(Requisicao.STATUS_FINALIZADA)){
                    motorista = requisicao.getMotorista();
                    abrirTelaCorrida(requisicao.getId(), motorista, true);
                }

            }
        }

        @Override
        public void onCancelled(DatabaseError databaseError) {

        }
    });

}

private void recuperarLocalizacaoUsuario() {

    locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);

    locationListener = new LocationListener() {
        @Override
        public void onLocationChanged(Location location) {

            //recuperar latitude e longitude
            String latitude = String.valueOf(location.getLatitude());
            String longitude = String.valueOf(location.getLongitude());

            //Atualizar GeoFire
            UsuarioFirebase.atualizarDadosLocalizacao(
                    location.getLatitude(),
                    location.getLongitude()
            );

            if( !latitude.isEmpty() && !longitude.isEmpty() ){
                motorista.setLatitude(latitude);
                motorista.setLongitude(longitude);

                adicionaEventoCliqueRecyclerView();
                locationManager.removeUpdates(locationListener);
                adapter.notifyDataSetChanged();
            }

        }

        @Override
        public void onStatusChanged(String provider, int status, Bundle extras) {

        }

        @Override
        public void onProviderEnabled(String provider) {

        }

        @Override
        public void onProviderDisabled(String provider) {

        }
    };

    //Solicitar atualizações de localização
    if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED ) {
        locationManager.requestLocationUpdates(
                LocationManager.GPS_PROVIDER,
                0,
                0,
                locationListener
        );
    }


}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.menu_main, menu);
    return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {

    switch (item.getItemId()){
        case R.id.menuSair :
            autenticacao.signOut();
            finish();
            break;
    }

    return super.onOptionsItemSelected(item);
}

private void abrirTelaCorrida(String idRequisicao, Usuario motorista, boolean requisicaoAtiva){
    Intent i = new Intent(RequisicoesActivity.this, CorridaActivity.class );
    i.putExtra("idRequisicao", idRequisicao );
    i.putExtra("motorista", motorista );
    i.putExtra("requisicaoAtiva", requisicaoAtiva );
    startActivity( i );
}

private void inicializarComponentes(){

    getSupportActionBar().setTitle("Requisições");

    //Configura componentes
    recyclerRequisicoes = findViewById(R.id.recyclerRequisicoes);
    textResultado = findViewById(R.id.textResultado);

    //Configurações iniciais
    motorista = UsuarioFirebase.getDadosUsuarioLogado();
    autenticacao = ConfiguracaoFirebase.getFirebaseAutenticacao();
    firebaseRef = ConfiguracaoFirebase.getFirebaseDatabase();

    //Configurar RecyclerView
    adapter = new RequisicoesAdapter(listaRequisicoes, getApplicationContext(), motorista );
    RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getApplicationContext());
    recyclerRequisicoes.setLayoutManager( layoutManager );
    recyclerRequisicoes.setHasFixedSize(true);
    recyclerRequisicoes.setAdapter( adapter );

    recuperarRequisicoes();

}

private void adicionaEventoCliqueRecyclerView(){

    //Adiciona evento de clique no recycler
    recyclerRequisicoes.addOnItemTouchListener(
            new RecyclerItemClickListener(
                    getApplicationContext(),
                    recyclerRequisicoes,
                    new RecyclerItemClickListener.OnItemClickListener() {
                        @Override
                        public void onItemClick(View view, int position) {
                            Requisicao requisicao = listaRequisicoes.get(position);
                            abrirTelaCorrida(requisicao.getId(), motorista, false);
                        }

                        @Override
                        public void onLongItemClick(View view, int position) {

                        }

                        @Override
                        public void onItemClick(AdapterView parent, View view, int position, long id) {

                        }
                    }
            )
    );

}

private void recuperarRequisicoes(){

    DatabaseReference requisicoes = firebaseRef.child("requisicoes");

    Query requisicaoPesquisa = requisicoes.orderByChild("status")
            .equalTo(Requisicao.STATUS_AGUARDANDO);

    requisicaoPesquisa.addValueEventListener(new ValueEventListener() {
        @Override
        public void onDataChange(DataSnapshot dataSnapshot) {

            if( dataSnapshot.getChildrenCount() > 0 ){
                textResultado.setVisibility( View.GONE );
                recyclerRequisicoes.setVisibility( View.VISIBLE );
            }else {
                textResultado.setVisibility( View.VISIBLE );
                recyclerRequisicoes.setVisibility( View.GONE );
            }

            listaRequisicoes.clear();
            for ( DataSnapshot ds: dataSnapshot.getChildren() ){
                Requisicao requisicao = ds.getValue( Requisicao.class );
                listaRequisicoes.add( requisicao );
            }

            adapter.notifyDataSetChanged();

        }

        @Override
        public void onCancelled(DatabaseError databaseError) {

        }
    });

}

}}

XML – RECYCLER

LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android"
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
android: orientation = "vertical"
android: padding = "16dp">




ACTIVITY ADAPTER CODE

public class RequisicoesAdapter extends RecyclerView.Adapter {

private List requisicoes;
private Context context;
private Usuario motorista;

public RequisicoesAdapter(List requisicoes, Context context, Usuario motorista) {
    this.requisicoes = requisicoes;
    this.context = context;
    this.motorista = motorista;
}

@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View item = LayoutInflater.from(parent.getContext()).inflate(R.layout.adapter_requisicoes, parent, false);
    return new MyViewHolder( item ) ;
}

@Override
public void onBindViewHolder(MyViewHolder holder, int position) {

    Requisicao requisicao = requisicoes.get( position );
    Usuario passageiro = requisicao.getPassageiro();

    holder.nome.setText( passageiro.getNome() );

    if(motorista!= null){

        LatLng localPassageiro = new LatLng(
                Double.parseDouble(passageiro.getLatitude()),
                Double.parseDouble(passageiro.getLongitude())
        );

        LatLng localMotorista = new LatLng(
                Double.parseDouble(motorista.getLatitude()),
                Double.parseDouble(motorista.getLongitude())
        );
        float distancia = Local.calcularDistancia(localPassageiro, localMotorista);
        String distanciaFormatada = Local.formatarDistancia(distancia);
        holder.distancia.setText(distanciaFormatada + "- aproximadamente");

    }

}

@Override
public int getItemCount() {
    return requisicoes.size();
}

public class MyViewHolder extends RecyclerView.ViewHolder{

    TextView nome, distancia;

    public MyViewHolder(View itemView) {
        super(itemView);

        nome = itemView.findViewById(R.id.textRequisicaoNome);
        distancia = itemView.findViewById(R.id.textRequisicaoDistancia);

    }
}

}}
HELP CODE – ACTIVITY

public class RecyclerItemClickListener implements RecyclerView.OnItemTouchListener {

    private OnItemClickListener mListener;
    GestureDetector mGestureDetector;

    @Override
    public boolean onInterceptTouchEvent(RecyclerView rv, MotionEvent e) {
        View childView = rv.findChildViewUnder(e.getX(), e.getY());
        if (childView != null && mListener != null && mGestureDetector.onTouchEvent(e)) {
            mListener.onItemClick(childView, rv.getChildAdapterPosition(childView));
            return true;
        }
        return false;
    }

    @Override
    public void onTouchEvent(RecyclerView rv, MotionEvent e) {

    }

    @Override
    public void onRequestDisallowInterceptTouchEvent(boolean disallowIntercept) {

    }

    public interface OnItemClickListener extends AdapterView.OnItemClickListener {
        void onItemClick(View view, int position);

        void onLongItemClick(View view, int position);
    }

    public RecyclerItemClickListener(Context context, final RecyclerView recyclerView, OnItemClickListener listener) {
        mListener = listener;
        mGestureDetector = new GestureDetector(context, new GestureDetector.SimpleOnGestureListener() {
            @Override
            public boolean onSingleTapUp(MotionEvent e) {
                return true;
            }

            @Override
            public void onLongPress(MotionEvent e) {
                View child = recyclerView.findChildViewUnder(e.getX(), e.getY());
                if (child != null && mListener != null) {
                    mListener.onLongItemClick(child, recyclerView.getChildAdapterPosition(child));
                }
            }
        });

    }
}

THANKS FOR THOSE WHO CAN HELP ME

android studio – Change article position of a recycler view?

You will see, I have a problem with it and I need your help. I have a recycler that operates horizontally.
Enter the description of the image here

I would like me to change my position or move to the next item when clicking the "Next" button. If I do this manually, scrolling will switch items one by one and will not be executed. Help please, this is my code:
public class Promotions Adapter extends RecyclerView.Adapter {

ArrayList list promotions;
Context mContext;

public PromotionsAdapter (ArrayList listPromotions, Context mContext) {
this.listPromotions = listPromotions;
this.mContext = mContext;
}

@Override
public ViewHolderPromotions onCreateViewHolder (ViewGroup parent, int viewType) {

View v = LayoutInflater.from (parent.getContext ()) .inflate (R.layout.combo_item, null, false);
return new ViewHolderPromotions (v);

}

@Override
public void onBindViewHolder (ViewHolderPromociones owner, final int position) {

final ViewHolderPromotions viewHolder = (ViewHolderPromotions) owner;
End product item = listPromociones.get (position);


holder.BtnNext.setOnClickListener (new View.OnClickListener () {
@Override
public void onClick (view view) {
Toast.makeText (mContext, "" + position, Toast.LENGTH_SHORT) .show ();
}
});

holder.BtnAgregarCombo.setOnClickListener (new View.OnClickListener () {
@Override
public void onClick (view view) {

Toast.makeText (mContext, "" + position, Toast.LENGTH_SHORT) .show ();
}
});

holder.FotoCombo.setImageResource (item.getFoto ());
holder.FotoCombo.setScaleType (ImageView.ScaleType.FIT_XY);


}

@Override
public int getItemCount () {
return listPromotions.size ();
}

public class ViewHolderPromotions extends RecyclerView.ViewHolder {
Button BtnAddCombo, BtnNext;
ImageView PhotoCombo;

public ViewHolderPromotions (View itemView) {
great (itemView);

BtnAddCombo = itemView.findViewById (R.id.BtnAddCombo);
FotoCombo = itemView.findViewById (R.id.FotoCombo);
BtnNext = itemView.findViewById (R.id.Btnnext);


}
}