3 回答
TA贡献1810条经验 获得超4个赞
先试试这个
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try{
if (v.getId() == R.id.button) {
//Send Message to Server
}else {
throw new serverExceptionerror ("Server hasn't connected");
}
}
catch (serverExceptionerror ex) {
Toast.makeText(ex.getMessage(),Toast.LENGTH_LONG).show();
}
}
}
TA贡献1798条经验 获得超7个赞
先试试这个
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try{
if (v.getId() == R.id.button) {
//Send Message to Server
}else {
throw new serverExceptionerror ("Server hasn't connected");
}
}
catch (serverExceptionerror ex) {
Toast.makeText(ex.getMessage(),Toast.LENGTH_LONG).show();
}
}
}
添加回答
举报