Saturday 15 September 2012

android - recyclerview No adapter attached; skipping layout -



android - recyclerview No adapter attached; skipping layout -

just implemented recyclerview in code, replacing listview.

everything works fine. objects displayed.

but logcat says

15:25:53.476 e/recyclerview﹕ no adapter attached; skipping layout

15:25:53.655 e/recyclerview﹕ no adapter attached; skipping layout

for code

artistarrayadapter adapter = new artistarrayadapter(this, artists); recyclerview = (recyclerview) findviewbyid(r.id.cardlist); recyclerview.sethasfixedsize(true); recyclerview.setadapter(adapter);`` recyclerview.setlayoutmanager(new linearlayoutmanager(this));

as can see have attached adapter recycleview. why maintain getting error?

i have read other questions related same problem none helps.

can create sure calling these statements "main" thread (for illustration within oncreate method). phone call same statements "delayed" method. in case resultcallback, same message.

in fragment, calling code below within resultcallback method produces same message. after moving code onconnected method within app, message gone...

linearlayoutmanager llm = new linearlayoutmanager(this); llm.setorientation(linearlayoutmanager.vertical); list.setlayoutmanager(llm); list.setadapter( adapter );

android recyclerview

No comments:

Post a Comment