我把一个View放在Dialog里面LayoutInflater factory = LayoutInflater.from(Test2Activity.this);
final View textEntryView = factory.inflate(R.layout.dialog_input, null);new AlertDialog.Builder(Test2Activity.this)
.setTitle("账单查询")
.setView(textEntryView)
.setPositiveButton("发送",
new DialogInterface.OnClickListener() { @Override
public void onClick(DialogInterface arg0,
int arg1) {
// TODO Auto-generated method stub
EditText et1 = (EditText) findViewById(R.id.username_edit);
myreply += et1.getText().toString();
Intent replyIntent = new Intent(
Intent.ACTION_SENDTO, Uri
.parse("smsto:" + "139191*****"));
replyIntent.putExtra("sms_body", myreply);
startActivity(replyIntent);
}
})但是这个Dialog在程序中就是出不来。eclipse也不报错
final View textEntryView = factory.inflate(R.layout.dialog_input, null);new AlertDialog.Builder(Test2Activity.this)
.setTitle("账单查询")
.setView(textEntryView)
.setPositiveButton("发送",
new DialogInterface.OnClickListener() { @Override
public void onClick(DialogInterface arg0,
int arg1) {
// TODO Auto-generated method stub
EditText et1 = (EditText) findViewById(R.id.username_edit);
myreply += et1.getText().toString();
Intent replyIntent = new Intent(
Intent.ACTION_SENDTO, Uri
.parse("smsto:" + "139191*****"));
replyIntent.putExtra("sms_body", myreply);
startActivity(replyIntent);
}
})但是这个Dialog在程序中就是出不来。eclipse也不报错
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货