我有一个活动,它的主题是 dialog 。在这个活动中,有 10 个编辑文本。对于一个编辑框,我无法为编辑框设置文本。
公共无效 onCreate(Bundle savedInstanceState) {
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
is_tablet=SharedVariables.sharedPrefDate.getBoolean("isTablet", false);
if(!is_tablet){
super.setTheme(android.R.style.Theme_Black_NoTitleBar);
}
//overridePendingTransition(R.anim.slide_bottom_to_top,0);
super.onCreate(savedInstanceState);
activity=UpdateCasePersonAddressScreen.this;
setContentView(R.layout.update_person_address_screen);
//allocating memory to objBLAddCasePersonScreenOperations
objBLAddPersonAddressScreenOperations=new BLAddUpdatePersonAddressScreenOperations();
objBLCommonOperations=new BLCommonOperations();
getAllIds();
//objPersonAddress=new clsPersonAddress();
bundle = getIntent().getExtras();
//code to get all objects using Bundle from previous activity
if(bundle!=null){
objPersonAddress = (clsPersonAddress) bundle.getParcelable("clsPersonAddress");
System.out.println("from Extras");
bundle=null;
}
initTextFields();
inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
/* if (inputMethodManager != null) {
inputMethodManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
}*/
}
public void initTextFields(){
updatePersonAddressTitleEditText.setText(objPersonAddress.getAddressTitle());
updatePersonAddressMemoEditText.setText(objPersonAddress.getAddressMemo());
updatePersonAddressNameEditText.setText(objPersonAddress.getAddressName());
updatePersonAddressBusinessNameEditText.setText(objPersonAddress.getAddressBusinessName());
updatePersonAddressWorkPhoneEditText.setText(objPersonAddress.getAddressWorkPhone());
updatePersonAddressHomePhoneEditText.setText(objPersonAddress.getAddressHomePhone());
updatePersonAddressMobilePhoneEditText.setText(objPersonAddress.getAddressMobilePhone());
updatePersonAddressAddressLine1EditText.setText(objPersonAddress.getAddressLine1());
updatePersonAddressAddressLine2EditText.setText(objPersonAddress.getAddressLine2());
updatePersonAddressCityEditText.setText(objPersonAddress.getAddressCity());
System.out.println("objPersonAddress.getAddressState()))))))))))))))))))))))))))))))))))"+objPersonAddress.getAddressState());
updatePersonAddressStateEditText.setText(objPersonAddress.getAddressState().toString());//setText(objPersonAddress.getAddressState(), TextView.BufferType.EDITABLE);
System.out.println("updatePersonAddressStateEditText text is now is:"+updatePersonAddressStateEditText.getText().toString()+"null check:"+updatePersonAddressStateEditText.toString());
System.out.println("below objPersonAddress.getAddressState()))))))))))))))))))))))))))))))))))"+objPersonAddress.getAddressState());
updatePersonAddressZipEditText.setText(objPersonAddress.getAddressZip());
updatePersonAddressCountryEditText.setText(objPersonAddress.getAddressCountry());
}
任何机构都可以在这个问题上帮助我。提前感谢任何帮助。