Cannot resolve maketext() method of Toast

后端 未结 18 2397
旧时难觅i
旧时难觅i 2021-02-07 02:02

I am getting error while creating a Toast

Toast toast = Toast.makeText(this, text, duration);

I am getting cannot resolve ma

18条回答
  •  终归单人心
    2021-02-07 02:22

    Try Toast toast = Toast.makeText(getActivity(), text, duration);

    You may also wish to append .show() if you want it to display

提交回复
热议问题