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

前端 未结 2 1539
无人共我
无人共我 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:15

    Fix simple by removing null:

    Intent intent = new Intent(Events.this, AddEvent.class);
    
    0 讨论(0)
  • 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);

    0 讨论(0)
提交回复
热议问题