fun myToast(context: Context, text: String, time: Int) {
//在实际调用前先设置Toast的text为null一次就ok
val makeText = Toast.makeText(context, null, time)
makeText.setText(text)
makeText.show()
}
myToast(this, "hello", Toast.LENGTH_SHORT) 调用
fun myToast(context: Context, text: String, time: Int) {
//在实际调用前先设置Toast的text为null一次就ok
val makeText = Toast.makeText(context, null, time)
makeText.setText(text)
makeText.show()
}
myToast(this, "hello", Toast.LENGTH_SHORT) 调用