我尝试在具有不同布局的对话框上设置TextView,但TextView上的文本不会更改。我为此目的使用该代码:
public void onDialogPositiveClick(DialogFragment dialog) {
EditText et=(EditText)dialog.getDialog().findViewById(R.id.editText1);
dosyaAdi=et.getText().toString();
TextView txv=(TextView) dialog.getDialog().findViewById(R.id.header);
txv.setText(parametre);
if(dosyaIslemi){
generateFeatures kayit=new generateFeatures(this,dosyaAdi);
}
else{
generateFeatures kayit=new generateFeatures(this,dosyaAdi);
}
sm.registerListener(this, myAccelerometer,50000);
}
答案 0 :(得分:0)
dialog.setTitle(text)有什么问题; ?
只需使用:
dialog.getDialog().setTitle("Title here");