每次在对话框中设置textView的结果,应用会崩溃。对话框是通过链接包含textView的xml,并且这个textView就是需要更新的。
AlertDialog.Builder alert = new AlertDialog.Builder(this);
LayoutInflater factory = LayoutInflater.from(this);
resultOne=(TextView)findViewById(R.id.resultOne); //resultone is a textview in xml dialog
resultOne.setText("hello"); //this code is making the app close
final View textEntryView = factory.inflate(R.layout.dialog, null);
alert.setView(textEntryView);
alert.show();