当前位置:   article > 正文

AlertDialog实现setView及点击事件_alertdialog setview

alertdialog setview

public static final AlertDialog createNewClientAlertDialog(final Activity aty,
   final NewClientInfo newClinetRet) {
   LayoutInflater factory = LayoutInflater.from(aty);
         View view = factory.inflate(R.layout.update_client_dialog, null);
         ImageView image = (ImageView)view.findViewById(R.id.overprint);
        image.setOnClickListener(new View.OnClickListener() {
        public void onClick(View arg0) {
        Toast.makeText(aty, "提示内容", Toast.LENGTH_LONG).show();
        }
  });
  Builder builder = new AlertDialog.Builder(aty);
  builder.setIcon(R.drawable.update_dialog_hint);
  builder.setTitle(R.string.dlg_hintmessage_title);
  builder.setView(view);
  builder.setPositiveButton(R.string.close,
    new DialogInterface.OnClickListener() {
   @Override
   public void onClick(DialogInterface dialog, int which) {
    aty.finish();
   }
  });
  builder.setNegativeButton(R.string.update,
    new DialogInterface.OnClickListener() {
   @Override
   public void onClick(DialogInterface dialog, int which) {
    aty.finish();
   }
  });
  return builder.create();
 }

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/463039
推荐阅读
相关标签
  

闽ICP备14008679号