Start new Activity with onClick() in RecyclerView

后端 未结 10 746
渐次进展
渐次进展 2020-12-03 06:12

I want to go into a new Activity with the onClick() method but my code is not working. Can you please offer some advice. I have some issues with the recyclerView, since it\'

10条回答
  •  一生所求
    2020-12-03 06:41

    you have to create constructor of FragmentOne like this

    Activity activity;
    FragmentOne(Acticity activity){ 
         this.activity = activity;
    }
    

    After that start activity with the reference of that activity like this

    activity.startActivity(intent);

提交回复
热议问题