当前位置: 首页>>代码示例>>Java>>正文


Java Dialog类代码示例

本文整理汇总了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();
        }
}
 
开发者ID:getsadzeg,项目名称:AreYouAlive,代码行数:27,代码来源:MainActivity.java

示例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();
                    }
                });
            }
        }
    });





}
 
开发者ID:JianxunRao,项目名称:FangYanShuo,代码行数:39,代码来源:RegisterActivity.java

示例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();
}
 
开发者ID:flyingrub,项目名称:SpeedMeter,代码行数:12,代码来源:MainActivity.java


注:本文中的com.gc.materialdesign.widgets.Dialog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。