Displaying integer on toast

前端 未结 4 1270
别跟我提以往
别跟我提以往 2020-11-29 12:04

Im trying to display a toast message with integer inside it This is how i tried to do it:

 Toast.makeText(this,bignum,Toast.LENGTH_LONG).show();
4条回答
  •  攒了一身酷
    2020-11-29 12:12

    you need a String

    Toast.makeText(this, String.valueOf(bignum),Toast.LENGTH_LONG).show();
    

    otherwise android will try to look it up for a String with id bignum, in your strings.xml file

提交回复
热议问题