当用户点击 EditText 时,我加载了一个布局 xml,如下所示。但是程序在执行 setContentView(descriptionView); 时总是崩溃;问题是什么?
EditText DescEditTxt = (EditText) addView.findViewById(R.id.descriptionEdit);
if(DescEditTxt != null)
{
DescEditTxt.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
final View descriptionView = getLayoutInflater().inflate(R.layout.description, null);
setContentView(descriptionView);
}
});
}