如何在android中添加messagebox [英] How do I add messagebox in android
问题描述
此代码发生错误,例如不幸停止
我尝试过:
Textview lblalert =(TextView)findViewById(R.id.txtm);
lblalert.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(查看v){
AlertDialog alert = new AlertDialog.Builder(Home.this).create();
alert.setTitle(Alert);
alert.setMessage(你没有注册BBN会员。要查看详细信息,请告知管理员);
alert.show();
}
});
检查出来 android对话框 [ ^ ]
Android只有toast,相当于messagebox
Android Toast示例 - javatpoint [ ^ ]
Toasts | Android开发者 [ ^
the error is occurring with this code like "unfortunately stop"
What I have tried:
Textview lblalert = (TextView)findViewById(R.id.txtm);
lblalert.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog alert = new AlertDialog.Builder(Home.this).create();
alert.setTitle("Alert");
alert.setMessage("You are not registered BBN member. To see the detail please cantact to administrator");
alert.show();
}
});
Check this out android dialogs[^]
Android only have toast which is equivalent of messagebox
Android Toast Example - javatpoint[^]
Toasts | Android Developers[^]
这篇关于如何在android中添加messagebox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!