i'm building my first ever app in Android Studio. The purpose of the app is to connect to my Drupal website API and take data from it.
I have no visisble errors in my code but when i use logcat it keeps coming up with the following error:
E/RecyclerView: No adapter attached; skipping layout
This is some of my code:
public class MainActivity extends AppCompatActivity implements ExampleAdapter.onItemClickListener {
public static final String EXTRA_TITLE = "title";
public static final String EXTRA_BODY = "body";
public static final String EXTRA_LINK = "link";
private RecyclerView mRecyclerView;
private ExampleAdapter mExampleAdapter;
private ArrayList<ExampleItem> mExampleList;
private RequestQueue mRequestQueue;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mRecyclerView = findViewById(R.id.recycler_view);
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
mRecyclerView.setHasFixedSize(true);
mExampleList = new ArrayList<>();
mRequestQueue = Volley.newRequestQueue(this);
parseJSON();
}
I already viewed similar questions on Stack but none of them fixed it.
question from:
https://stackoverflow.com/questions/65640936/e-recyclerview-no-adapter-attached-skipping-layout-help 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…