Cannot resolve maketext() method of Toast

后端 未结 18 1241
南笙
南笙 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:26

    in the onClick method try this

    
    Toast.makeText(view.getContext(), "sorry", Toast.LENGTH_LONG).show();
    
    
    

    it did work form me.

提交回复
热议问题