【发布时间】:2017-04-27 00:25:34
【问题描述】:
我想延迟 20 秒的 toast 消息,所以这是我的代码
b1=(Button)findViewById(R.id.button4);
b1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(MainActivity.this,"Welcome to my first project in android",Toast.LENGTH_LONG).show();
}
});
布局
<Button
android:id="@+id/button4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/button"
android:layout_below="@+id/button"
android:layout_marginTop="67dp"
android:text="About" />
那我该怎么做呢?
【问题讨论】: