本文整理汇总了Java中com.gc.materialdesign.widgets.Dialog类的典型用法代码示例。如果您正苦于以下问题:Java Dialog类的具体用法?Java Dialog怎么用?Java Dialog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Dialog类属于com.gc.materialdesign.widgets包,在下文中一共展示了Dialog类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buttonflatOnClick
import com.gc.materialdesign.widgets.Dialog; //导入依赖的package包/类
public void buttonflatOnClick(View v) {
username = (EditText) findViewById(R.id.editText1);
password = (EditText) findViewById(R.id.editText2);
userstring = username.getText().toString();
System.out.println(soldierSize);
if (password.getText().toString().equals("lala") && username.getText().toString().equals(names[0]) || username.getText().toString().equals(names[3])) {
startActivity(new Intent(MainActivity.this, Activity2.class));
finish();
}
else if(password.getText().toString().equals("lala") && username.getText().toString().equals(names[2]) || username.getText().toString().equals(names[3])) {
startActivity(new Intent(MainActivity.this, Activity2.class));
finish();
}
else if(password.getText().toString().equals("lala") && username.getText().toString().equals(names[4]) || username.getText().toString().equals(names[5])) {
startActivity(new Intent(MainActivity.this, Activity2.class));
finish();
}
else if(password.getText().toString().equals("lala") && username.getText().toString().equals(names[6]) || username.getText().toString().equals(names[7])) {
startActivity(new Intent(MainActivity.this, Activity2.class));
finish();
}
else {
Dialog dialog = new Dialog(this, "SOS", "You're trying to access our data. Go to hell. Regards.");
dialog.show();
}
}
示例2: register
import com.gc.materialdesign.widgets.Dialog; //导入依赖的package包/类
private void register(){
String account=et_account.getText().toString();
String password=et_password.getText().toString();
AVUser avUser=new AVUser();
avUser.setUsername(account);
avUser.setPassword(password);
avUser.signUpInBackground(new SignUpCallback() {
@Override
public void done(AVException e) {
if(e==null){
//返回activity
Intent intent=new Intent();
setResult(RESULT_OK,intent);
intent.putExtra("account",et_account.getText().toString());
intent.putExtra("password",et_password.getText().toString());
finish();
}else {
final Dialog dialog=new Dialog(RegisterActivity.this,"错误","注册失败,请检查你的账号与密码");
dialog.show();
dialog.getButtonAccept().setText("好的");
dialog.getButtonAccept().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
}
}
});
}
示例3: showGpsDisabledDialog
import com.gc.materialdesign.widgets.Dialog; //导入依赖的package包/类
public void showGpsDisabledDialog(){
Dialog dialog = new Dialog(this, getResources().getString(R.string.gps_disabled), getResources().getString(R.string.please_enable_gps));
dialog.setOnAcceptButtonClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent("android.settings.LOCATION_SOURCE_SETTINGS"));
}
});
dialog.show();
}