自定义的AlertDialog获取软键盘和editext中的内容
来源:互联网 发布:淘宝开放平台 教程 编辑:程序博客网 时间:2024/05/17 20:30
/*弹框布局展示*/
loginalert= new AlertDialog.Builder(MainActivity.this);
textEntryView = getLayoutInflater().inflate(R.layout.loginalertdialoglayout, null);
loginalert.setView(textEntryView);
/*编辑框的定义*/
account=(EditText)textEntryView.findViewById(R.id.account);
password=(EditText)textEntryView.findViewById(R.id.password);
System.out.println("哈哈!你好的啦~");
loginalert.setPositiveButton("确定", new android.content.DialogInterface.OnClickListener()
{
//@Override
public void onClick(DialogInterface dialog, int which)
{
studentpassword=password.getText().toString();
studentaccount=account.getText().toString();
System.out.println(studentaccount+"studentaccount"+studentpassword+"studentpassword");
try {
if(studentaccount.equals("")||studentpassword.equals(""))
{
Toast.makeText(getApplicationContext(), "请填入账号和密码",
Toast.LENGTH_LONG).show();
}
else if(studentaccount!=""&&studentpassword!="")
{
MainActivity.this.information();
}
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}});
loginalert.setNegativeButton("取消", new android.content.DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
dialog.dismiss();
}
});
loginalert.create().show();
loginalert= new AlertDialog.Builder(MainActivity.this);
textEntryView = getLayoutInflater().inflate(R.layout.loginalertdialoglayout, null);
loginalert.setView(textEntryView);
/*编辑框的定义*/
account=(EditText)textEntryView.findViewById(R.id.account);
password=(EditText)textEntryView.findViewById(R.id.password);
System.out.println("哈哈!你好的啦~");
loginalert.setPositiveButton("确定", new android.content.DialogInterface.OnClickListener()
{
//@Override
public void onClick(DialogInterface dialog, int which)
{
studentpassword=password.getText().toString();
studentaccount=account.getText().toString();
System.out.println(studentaccount+"studentaccount"+studentpassword+"studentpassword");
try {
if(studentaccount.equals("")||studentpassword.equals(""))
{
Toast.makeText(getApplicationContext(), "请填入账号和密码",
Toast.LENGTH_LONG).show();
}
else if(studentaccount!=""&&studentpassword!="")
{
MainActivity.this.information();
}
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}});
loginalert.setNegativeButton("取消", new android.content.DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
dialog.dismiss();
}
});
loginalert.create().show();
- 自定义的AlertDialog获取软键盘和editext中的内容
- 自定义AlertDialog中的EditText无法弹出软键盘的解决
- Editext不弹出软键盘的方法
- 自定义AlertDialog的写法和弹出软键盘和覆盖状态栏
- 取消editext 默认焦点获取,不再自动弹出软键盘
- AlertDialog中的EditText不能弹出软键盘的解决方法
- 【Android】AlertDialog中的EditText不能弹出软键盘的问题
- Android Editext 点击两次后软键盘遮挡 Editext控件的问题
- android AlertDialog中的Edittext自动获取焦点并弹出软键盘
- AlertDilaog Editext点击不能弹出软键盘
- 自定义AlertDialog里的EditText不能弹出软键盘的解决
- 自定义的AlertDialog里面点击EditText的时候软键盘不能弹出
- AlertDialog 自定义布局 以及 EditText 无法弹出软键盘的解决
- 解决在自定义AlertDialog中EditText无法弹出软键盘的问题
- AlertDialog自定义布局中有editText,不能弹出软键盘
- 自定义alertdialog,中有edittext不能弹出软键盘,解决
- AlertDialog内容自定义
- 自定义Editext控制输入字数限制的文本框Editext
- 读书与学习
- ubuntu 建立samba
- hdu2199 Can you solve this equation? (二分搜索)
- 【python初学】Python批量解压RAR脚本
- Android UI界面
- 自定义的AlertDialog获取软键盘和editext中的内容
- psexec 首次执行需要验证问题
- Hibernate的优化方案
- 正在使用或者导入的项目,项目名那里出现了红色感叹号解决方案
- SQL数据类型
- 这样解决浏览器不兼容问题
- iis7 iis8 system.webServer/modules、system.webServer/handlers 锁定解锁命令
- LXC in Ubuntu 12.04 LTS by Stéphane Graber
- 面向对象的基本思想