Attribute dialog changes on rotation

400
0
03-16-2012 05:04 AM
BojanBukovic
New Contributor
Hello again,

Obviously I have some problems whenever orientation changes. In my application I've created one "editing dialog" similar to one from AttributeEditor sample. It works well but the problem is when the screen orientation is changed, the dialog is not displayed correctly - All items of the dialog (list of attributes and edit fields) are missing, except buttons which are defined in xml file.

It looks like listAdapter variable (which if of type AttributeListAdapter) is null after changing the screen orientation despite of this part of code in the onCreate method:

    if (featureLayer.isInitialized()) {
      listAdapter = new AttributeListAdapter(this, featureLayer.getFields(), featureLayer.getTypes(),
          featureLayer.getTypeIdField());

    } else {
      featureLayer.setOnStatusChangedListener(new OnStatusChangedListener() {

        private static final long serialVersionUID = 1L;

        public void onStatusChanged(Object source, STATUS status) {

          if (status == STATUS.INITIALIZED) {
            listAdapter = new AttributeListAdapter(AttributeEditorActivity.this, featureLayer.getFields(), featureLayer
                .getTypes(), featureLayer.getTypeIdField());
          }
        }
      });
    }



Any help would be appreciated.

Regards
0 Kudos
0 Replies