吐司,找不到方法

时间:2016-02-14 20:35:40

标签: android widget toast

也进行了导入 import android.widget.Toast;

String value = getIntent().getExtras().getString(VALUE);
Context context = this;
CharSequence text = value;
int duration = Toast.LENGTH_LONG;
public Toast T = Toast.makeText(context, text, duration);
T.show(); -  this is red and shows an error? does somebody knows what I did wrong?

1 个答案:

答案 0 :(得分:1)

改变:

Toast toast = new Toast(context);
toast.setDuration(Toast.LENGTH_SHORT);
toast.setText("");
toast.show();