2018.5.62

2018.5.62

if(Math.random()*2>1){
            // mock that the account is valid
        }
        else{
            AlertDialog.Builder builder = new AlertDialog.Builder(this);
            builder.setTitle("登录错误");
            builder.setMessage("请重新登录");
            builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    Intent intent = new Intent(MainActivity.this, LoginActivity.class);
                    startActivity(intent);
                }
            });
            AlertDialog dialog = builder.create();
            dialog.show();
        }

2018.5.62_第1张图片

你可能感兴趣的:(琉璃神社)