Intent is not working in my RecyclerView

后端 未结 4 890
被撕碎了的回忆
被撕碎了的回忆 2021-01-27 00:17

I use this code:

import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater         


        
4条回答
  •  清歌不尽
    2021-01-27 01:06

    Hi call your adapter such like this way :

     adapter = new MyAdapter(MainActivity.this,people);
     recyclerView.setAdapter(adapter);
    

    You can also get the view.getContext() inside you button onClick listener.

    I hope it can help you to resolved the problem. thank you.

提交回复
热议问题