I'm developing Android application that must show all images stored inside SD card. I did it successfully except I getting strange behavior when switching to landscape mode (in fact, I do not see anything in my grid).
In logcat I get this message : RecyclerView﹕ No adapter attached; skipping layout
Yes, I am using RecyclerView and this only happens in landscape, when I rotate back to portrait again, Fragment is retained and I can see every single bitmap inside my grid again.
Now, does anyone know why this is happening to me ? Here is how I set my adapter to recyclerView (inside a fragment):
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
if (cursor.moveToFirst()) {
adapter = new ImageAdapter(getActivity(), cursor, imageManager);
imagesGrid.setAdapter(adapter);
}
}
Oh, and by the way, I am using default GridLayoutManager for RecyclerView.