I am developing an Android application that should display all the images stored on an SD card. I did this successfully, except that I get strange behavior when switching to landscape mode (in fact, I see nothing in my grid).
In logcat, I get this message: RecyclerView: the adapter is not connected; skipping layout
Yes, I use RecyclerView, and this only happens in the landscape, when I return to the portrait again, the Fragment is saved, and again I see every raster map inside my grid.
Now, does anyone know why this is happening to me? This is how I installed my adapter for recyclerView (inside the 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 use the default GridLayoutManager for RecyclerView.
android adapter android-fragments android-recyclerview
env
source share