Toolbar repeating

2

Hello, I have a problem, my toolbar is repeating every time I add a new registry.

HowdoIsolveit?followthecodes:

publicclassListarReportesextendsBaseActivity{Usuariousuario;RepositorioReporterepositorioReporte;RecyclerViewrecyclerView;ReportListAdapteradapter;@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.recycler_view);Toolbartoolbar=(Toolbar)findViewById(R.id.toolbar_listar_reportes);if(toolbar!=null){setSupportActionBar(toolbar);getSupportActionBar().setDisplayHomeAsUpEnabled(true);getSupportActionBar().setCustomView(R.layout.teste);}//Recuperasessaodousuariousuario=(Usuario)getIntent().getSerializableExtra("usuario");

    recyclerView = (RecyclerView) findViewById(R.id.rv);
    recyclerView.setHasFixedSize(true);

    LinearLayoutManager llm = new LinearLayoutManager(this);
    recyclerView.setLayoutManager(llm);
    recyclerView.setItemAnimator(new DefaultItemAnimator());

    repositorioReporte = new RepositorioReporte(this);
    List<Reporte> reporte = repositorioReporte.listaQuery(usuario.getId());

    adapter = new ReportListAdapter(reporte);
    recyclerView.setAdapter(adapter);
}

<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.v7.widget.RecyclerView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/rv"
    />

    
asked by anonymous 30.11.2015 / 21:33

1 answer

2

As stated in the comments, your toolbar needs to be in the same XML as your reclycler view. Otherwise it is repeated in each item.

    
30.11.2015 / 22:15