課程
/移動(dòng)開(kāi)發(fā)
/Android
/Android攻城獅的第二門(mén)課(第2季)
為什么Toast toast=Toast.makeText(this, "" ,Toast.LENGTH_LONG).show(); ? 我的makeText會(huì)報(bào)錯(cuò)。
2018-03-17
源自:Android攻城獅的第二門(mén)課(第2季) 3-2
正在回答
Toast.makeText(MainActivity.this, str,Toast.LENGTH_SHORT ).show();
或者
Toast toast=Toast.makeText(this, "" ,Toast.LENGTH_LONG);
toast.show();
你是先聲明toast,申明后就不能再申明的后面調(diào)用show方法,而是通過(guò)變量toast.show()調(diào)用
舉報(bào)
本課程講帶你熟悉Android開(kāi)發(fā)中常用的調(diào)試方式,菜單、調(diào)試程序
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢(xún)優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2018-03-22
Toast.makeText(MainActivity.this, str,Toast.LENGTH_SHORT ).show();
或者
Toast toast=Toast.makeText(this, "" ,Toast.LENGTH_LONG);
toast.show();
你是先聲明toast,申明后就不能再申明的后面調(diào)用show方法,而是通過(guò)變量toast.show()調(diào)用