Translating this from AppCompatActivity to Fragment and having Intent errors, etc

前端 未结 2 1542
无人共我
无人共我 2021-01-29 06:37

I have been trying for a month doing a lot of research to translate this to Fragment since I need it for my navigation Menu. Basically I\'m creating an app. I\'m using my MainAc

2条回答
  •  迷失自我
    2021-01-29 07:21

    The problem is caused by this line:
    Intent intent = new Intent(Events.this, AddEvent.class, null);

    You should instantiate your Intent with one of the available Public constructors.
    In this case, I would suggest using new Intent(view.getContext(), AddEvent.class);

提交回复
热议问题