android 如何在对话框中获取edittext中的数据
本文来自:http://blog.sina.com.cn/s/blog_86193b540100tulr.html


//得到自定义对话框
      final View DialogView = a .inflate ( R.layout.loand, null);       
 
 //创建对话框
        
        AlertDialog dlg = new AlertDialog.Builder(loand.this)
        .setTitle("登录框")
        .setView(DialogView)//设置自定义对话框的样式      
        .setPositiveButton("登陆", //设置"确定"按钮
        new DialogInterface.OnClickListener() //设置事件监听
        {         
         
            public void onClick(DialogInterface dialog, int whichButton)
            {
              editText1 =(EditText) DialogView.findViewById(R.id.editText1);
             editText2 =(EditText) DialogView.findViewById(R.id.editText2);
             String id = editText1.getText().toString();
             String password = editText2.getText().toString();    
            
             //输入完成后,点击“确定”开始登陆             
             c_log judge = new c_log();
             boolean b_judge = judge.aa(id,password);
             if(b_judge){
              bar();
             }else{
              //加东西              
              DisplayToast("NO");              
             } 
            }
        })

更多相关文章

  1. android namespace 、样式、主题 (二)
  2. Android菜鸟日记14-对话框
  3. android-控件样式(Theme)自定义
  4. Android主题theme和样式style总结
  5. Android自定义对话框(Custom Dialog)
  6. Android 修改TextView字体样式
  7. Android 常用对话框Dialog封装
  8. Androidの自定义对话框AlertDialog(一)
  9. 【转】善用Android预定义样式来为我们的布局设置效果,大大节约代

随机推荐

  1. android include 使用
  2. android之将图片转化为圆形图片
  3. adt-bundle import android工程出现错误
  4. Android 代码生成界面Sample
  5. Android webView 使用back功能返回以前浏
  6. Android 动态隐藏显示导航栏,状态栏
  7. Android 中保存图片的代码
  8. Android 跳转Activity并通过Bundle对象传
  9. Android 密度转换多分辨率
  10. Android setTag和getTag()的使用