我自定义了一个AlertDialog,想要获取里面的editText的值,可是每次拿出来都是空,然后我在xml文件中的android:text中写上内容就能拿出来...这是为什么?获取的java代码如下
LayoutInflater layoutInflater = LayoutInflater.from(CustomerActivity.this);
View myLoginView = layoutInflater.inflate(R.layout.customer_manage_card_dialog, null);
/**
* 获得表单数据
*/
EditText et = (EditText) myLoginView.findViewById(R.id.cmaCardNo);
Looper.prepare();
toast(et.getText().toString()); //就是这里每次获得的都是空值
Looper.loop();
LayoutInflater layoutInflater = LayoutInflater.from(CustomerActivity.this);
View myLoginView = layoutInflater.inflate(R.layout.customer_manage_card_dialog, null);
/**
* 获得表单数据
*/
EditText et = (EditText) myLoginView.findViewById(R.id.cmaCardNo);
Looper.prepare();
toast(et.getText().toString()); //就是这里每次获得的都是空值
Looper.loop();

