Android Trouble with RecyclerView and Adapter -


i'm using recyclerview in app, works, there 2-3 things don't understand.

firstly, why getitemcount called few times ? when set log in function, can see 7 times log.

secondly, when set adapter, , define recyclerview, i'm doing after :

initadapter(); initrecycler(); initsomething(); 

the function initsomething called whereas initrecycler didn't load items. (i can see logs adapter job after initsomething...)

someone help/explain me ?

edit :

protected void initrecyclerview() {     this.recyclerview = (recyclerview) findviewbyid(r.id.recycler);     this.recyclerview.setadapter(this.adapter);     this.recyclerview.sethasfixedsize(true);     this.recyclerview.setlayoutmanager(new linearlayoutmanager(this));     this.recyclerview.setitemanimator(new defaultitemanimator()); } 


Comments