Program: 88755
Project: 88755
Buggy source:
private void loadScreen(){
  if (getActionBar() != null) {
    getActionBar().setHomeButtonEnabled(true);
    getActionBar().setDisplayHomeAsUpEnabled(true);
  }
  FrameLayout mFrame=new FrameLayout(this);
  mFrame.addView(LayoutInflater.from(getBaseContext()).inflate(R.layout.config,null));
  setContentView(mFrame);
  advancedDialog=new Dialog(this,android.R.style.Theme_Holo_Light_Dialog);
  advancedDialog.setTitle(getString(R.string.advanced));
  advancedDialog.setContentView(R.layout.advanced);
  android.view.WindowManager.LayoutParams params=advancedDialog.getWindow().getAttributes();
  params.width=LayoutParams.MATCH_PARENT;
  advancedDialog.getWindow().setAttributes(params);
  advancedDialog.setCancelable(true);
  advancedDialog.setCanceledOnTouchOutside(true);
  CheckBox tips=(CheckBox)advancedDialog.findViewById(R.id.tips);
  CheckBox cycle=(CheckBox)advancedDialog.findViewById(R.id.cycle);
  CheckBox ignoreEntries=(CheckBox)advancedDialog.findViewById(R.id.ignoreExisting);
  CheckBox useDay=(CheckBox)advancedDialog.findViewById(R.id.useDay);
  CheckBox rangeSound=(CheckBox)advancedDialog.findViewById(R.id.rangeSound);
  CheckBox jumpToPlot=(CheckBox)advancedDialog.findViewById(R.id.jumpToPlot);
  CheckBox barcodeScan=(CheckBox)advancedDialog.findViewById(R.id.barcodeScan);
  CheckBox nextEmptyPlot=(CheckBox)advancedDialog.findViewById(R.id.nextEmptyPlot);
  CheckBox quickGoTo=(CheckBox)advancedDialog.findViewById(R.id.quickGoTo);
  CheckBox disableShare=(CheckBox)advancedDialog.findViewById(R.id.disableShare);
  CheckBox disableEntryNavLeft=(CheckBox)advancedDialog.findViewById(R.id.disableEntryNavLeft);
  CheckBox disableEntryNavRight=(CheckBox)advancedDialog.findViewById(R.id.disableEntryNavRight);
  CheckBox dataGrid=(CheckBox)advancedDialog.findViewById(R.id.dataGrid);
  Button advCloseBtn=(Button)advancedDialog.findViewById(R.id.closeBtn);
  advCloseBtn.setOnClickListener(new OnClickListener(){
    public void onClick(    View v){
      advancedDialog.dismiss();
    }
  }
);
  tips.setChecked(ep.getBoolean("String_Node_Str",false));
  cycle.setChecked(ep.getBoolean("String_Node_Str",false));
  ignoreEntries.setChecked(ep.getBoolean("String_Node_Str",false));
  useDay.setChecked(ep.getBoolean("String_Node_Str",false));
  rangeSound.setChecked(ep.getBoolean("String_Node_Str",false));
  jumpToPlot.setChecked(ep.getBoolean("String_Node_Str",false));
  barcodeScan.setChecked(ep.getBoolean("String_Node_Str",false));
  nextEmptyPlot.setChecked(ep.getBoolean("String_Node_Str",false));
  quickGoTo.setChecked(ep.getBoolean("String_Node_Str",false));
  disableShare.setChecked(ep.getBoolean("String_Node_Str",false));
  disableEntryNavLeft.setChecked(ep.getBoolean("String_Node_Str",false));
  disableEntryNavRight.setChecked(ep.getBoolean("String_Node_Str",false));
  dataGrid.setChecked(ep.getBoolean("String_Node_Str",false));
  tips.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      invalidateOptionsMenu();
      MainActivity.reloadData=true;
    }
  }
);
  cycle.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      MainActivity.reloadData=true;
    }
  }
);
  ignoreEntries.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      MainActivity.reloadData=true;
    }
  }
);
  useDay.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      MainActivity.reloadData=true;
    }
  }
);
  rangeSound.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      MainActivity.reloadData=true;
    }
  }
);
  jumpToPlot.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      MainActivity.reloadData=true;
    }
  }
);
  nextEmptyPlot.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      MainActivity.reloadData=true;
    }
  }
);
  quickGoTo.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      MainActivity.reloadData=true;
    }
  }
);
  disableShare.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      MainActivity.reloadData=true;
    }
  }
);
  disableEntryNavLeft.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      MainActivity.reloadData=true;
    }
  }
);
  disableEntryNavRight.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      MainActivity.reloadData=true;
    }
  }
);
  barcodeScan.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      MainActivity.reloadData=true;
    }
  }
);
  dataGrid.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      MainActivity.reloadData=true;
    }
  }
);
  saveDialog=new Dialog(this,android.R.style.Theme_Holo_Light_Dialog);
  saveDialog.setTitle(getString(R.string.export));
  saveDialog.setContentView(R.layout.savefile);
  android.view.WindowManager.LayoutParams params2=saveDialog.getWindow().getAttributes();
  params2.width=LayoutParams.MATCH_PARENT;
  saveDialog.getWindow().setAttributes(params2);
  saveDialog.setCancelable(true);
  saveDialog.setCanceledOnTouchOutside(true);
  Button closeBtn=(Button)saveDialog.findViewById(R.id.closeBtn);
  closeBtn.setOnClickListener(new OnClickListener(){
    public void onClick(    View v){
      saveDialog.dismiss();
    }
  }
);
  exportFile=(EditText)saveDialog.findViewById(R.id.fileName);
  checkDB=(CheckBox)saveDialog.findViewById(R.id.formatDB);
  checkExcel=(CheckBox)saveDialog.findViewById(R.id.formatExcel);
  allColumns=(RadioButton)saveDialog.findViewById(R.id.allColumns);
  onlyUnique=(RadioButton)saveDialog.findViewById(R.id.onlyUnique);
  allTraits=(RadioButton)saveDialog.findViewById(R.id.allTraits);
  activeTraits=(RadioButton)saveDialog.findViewById(R.id.activeTraits);
  Button exportButton=(Button)saveDialog.findViewById(R.id.saveBtn);
  exportButton.setOnClickListener(new OnClickListener(){
    public void onClick(    View arg0){
      if (!checkDB.isChecked() & !checkExcel.isChecked()) {
        Toast.makeText(ConfigActivity.this,getString(R.string.noexportcheck),Toast.LENGTH_LONG).show();
        return;
      }
      if (!onlyUnique.isChecked() & !allColumns.isChecked()) {
        Toast.makeText(ConfigActivity.this,getString(R.string.nofieldcheck),Toast.LENGTH_LONG).show();
        return;
      }
      if (!activeTraits.isChecked() & !allTraits.isChecked()) {
        Toast.makeText(ConfigActivity.this,getString(R.string.notraitcheck),Toast.LENGTH_LONG).show();
        return;
      }
      newRange=new ArrayList<String>();
      if (onlyUnique.isChecked()) {
        newRange.add(ep.getString("String_Node_Str","String_Node_Str"));
      }
      if (allColumns.isChecked()) {
        String[] columns=MainActivity.dt.getRangeColumns();
        Collections.addAll(newRange,columns);
      }
      exportTrait=new ArrayList<String>();
      if (activeTraits.isChecked()) {
        String[] traits=MainActivity.dt.getVisibleTrait();
        Collections.addAll(exportTrait,traits);
      }
      if (allTraits.isChecked()) {
        String[] traits=MainActivity.dt.getAllTraits();
        Collections.addAll(exportTrait,traits);
      }
      saveDialog.dismiss();
      mHandler.post(exportData);
    }
  }
);
  setupDialog=new Dialog(this,android.R.style.Theme_Holo_Light_Dialog);
  setupDialog.setTitle(getString(R.string.setup));
  setupDialog.setContentView(R.layout.config);
  params=setupDialog.getWindow().getAttributes();
  params.width=LayoutParams.MATCH_PARENT;
  params.height=LayoutParams.WRAP_CONTENT;
  setupDialog.getWindow().setAttributes(params);
  setupDialog.setCancelable(true);
  setupDialog.setCanceledOnTouchOutside(true);
  setupList=(ListView)setupDialog.findViewById(R.id.myList);
  Button setupCloseBtn=(Button)setupDialog.findViewById(R.id.closeBtn);
  setupCloseBtn.setOnClickListener(new OnClickListener(){
    public void onClick(    View v){
      setupDialog.dismiss();
    }
  }
);
  personDialog=new Dialog(this,android.R.style.Theme_Holo_Light_Dialog);
  personDialog.setTitle(getString(R.string.personsetup));
  personDialog.setContentView(R.layout.person);
  personDialog.setCancelable(true);
  personDialog.setCanceledOnTouchOutside(true);
  final EditText firstName=(EditText)personDialog.findViewById(R.id.firstName);
  final EditText lastName=(EditText)personDialog.findViewById(R.id.lastName);
  Button yesButton=(Button)personDialog.findViewById(R.id.saveBtn);
  yesButton.setOnClickListener(new OnClickListener(){
    public void onClick(    View arg0){
      Editor e=ep.edit();
      e.putString("String_Node_Str",firstName.getText().toString());
      e.putString("String_Node_Str",lastName.getText().toString());
      e.apply();
      updateSetupList();
      personDialog.dismiss();
    }
  }
);
  fieldDialog2=new Dialog(this,android.R.style.Theme_Holo_Light_Dialog);
  fieldDialog2.setTitle(getString(R.string.fields));
  fieldDialog2.setContentView(R.layout.config);
  fieldDialog2.setCancelable(true);
  fieldDialog2.setCanceledOnTouchOutside(true);
  Button fdCloseBtn2=(Button)fieldDialog2.findViewById(R.id.closeBtn);
  fdCloseBtn2.setOnClickListener(new OnClickListener(){
    public void onClick(    View v){
      fieldDialog2.dismiss();
    }
  }
);
  ListView settingsList=(ListView)findViewById(R.id.myList);
  Button mainCloseBtn=(Button)findViewById(R.id.closeBtn);
  mainCloseBtn.setVisibility(View.GONE);
  String[] items2=new String[]{getString(R.string.fields),getString(R.string.traits),getString(R.string.setup),getString(R.string.export),getString(R.string.advanced),getString(R.string.language)};
  settingsList.setOnItemClickListener(new OnItemClickListener(){
    public void onItemClick(    AdapterView<?> av,    View arg1,    int position,    long arg3){
      Intent intent=new Intent();
switch (position) {
case 0:
        intent.setClassName(ConfigActivity.this,FileExploreActivity.class.getName());
      intent.putExtra("String_Node_Str",Constants.FIELDIMPORTPATH);
    startActivityForResult(intent,1);
  break;
case 1:
if (!ep.getBoolean("String_Node_Str",false)) {
  makeToast(getString(R.string.importtraitwarning));
  return;
}
intent.setClassName(ConfigActivity.this,TraitEditorActivity.class.getName());
startActivity(intent);
break;
case 2:
if (!ep.getBoolean("String_Node_Str",false)) {
makeToast(getString(R.string.nofieldloaded));
return;
}
showSetupDialog();
break;
case 3:
if (!ep.getBoolean("String_Node_Str",false)) {
makeToast(getString(R.string.nofieldloaded));
return;
}
 else if (MainActivity.dt.getTraitColumnsAsString() == null) {
makeToast(getString(R.string.notraitloaded));
return;
}
showSaveDialog();
break;
case 4:
advancedDialog.show();
break;
case 5:
showLanguageDialog();
break;
}
}
}
);
ArrayAdapter<String> adapter=new ArrayAdapter<String>(this,R.layout.listitem,items2);
settingsList.setAdapter(adapter);
SharedPreferences.Editor ed=ep.edit();
if (ep.getInt("String_Node_Str",-1) < getVersion()) {
ed.putInt("String_Node_Str",getVersion());
ed.apply();
Intent intent=new Intent();
intent.setClass(ConfigActivity.this,ChangelogActivity.class);
startActivity(intent);
}
if (!ep.getBoolean("String_Node_Str",false)) {
ed.putBoolean("String_Node_Str",true);
ed.apply();
showTipsDialog();
}
}

Fixed version (ground truth):
private void loadScreen(){
  if (getActionBar() != null) {
    getActionBar().setHomeButtonEnabled(true);
    getActionBar().setDisplayHomeAsUpEnabled(true);
  }
  FrameLayout mFrame=new FrameLayout(this);
  mFrame.addView(LayoutInflater.from(getBaseContext()).inflate(R.layout.config,null));
  setContentView(mFrame);
  advancedDialog=new Dialog(this,android.R.style.Theme_Holo_Light_Dialog);
  advancedDialog.setTitle(getString(R.string.advanced));
  advancedDialog.setContentView(R.layout.advanced);
  android.view.WindowManager.LayoutParams params=advancedDialog.getWindow().getAttributes();
  params.width=LayoutParams.MATCH_PARENT;
  advancedDialog.getWindow().setAttributes(params);
  advancedDialog.setCancelable(true);
  advancedDialog.setCanceledOnTouchOutside(true);
  CheckBox tips=(CheckBox)advancedDialog.findViewById(R.id.tips);
  CheckBox cycle=(CheckBox)advancedDialog.findViewById(R.id.cycle);
  CheckBox ignoreEntries=(CheckBox)advancedDialog.findViewById(R.id.ignoreExisting);
  CheckBox useDay=(CheckBox)advancedDialog.findViewById(R.id.useDay);
  CheckBox rangeSound=(CheckBox)advancedDialog.findViewById(R.id.rangeSound);
  CheckBox jumpToPlot=(CheckBox)advancedDialog.findViewById(R.id.jumpToPlot);
  CheckBox barcodeScan=(CheckBox)advancedDialog.findViewById(R.id.barcodeScan);
  CheckBox nextEmptyPlot=(CheckBox)advancedDialog.findViewById(R.id.nextEmptyPlot);
  CheckBox quickGoTo=(CheckBox)advancedDialog.findViewById(R.id.quickGoTo);
  CheckBox disableShare=(CheckBox)advancedDialog.findViewById(R.id.disableShare);
  CheckBox disableEntryNavLeft=(CheckBox)advancedDialog.findViewById(R.id.disableEntryNavLeft);
  CheckBox disableEntryNavRight=(CheckBox)advancedDialog.findViewById(R.id.disableEntryNavRight);
  CheckBox dataGrid=(CheckBox)advancedDialog.findViewById(R.id.dataGrid);
  Button advCloseBtn=(Button)advancedDialog.findViewById(R.id.closeBtn);
  advCloseBtn.setOnClickListener(new OnClickListener(){
    public void onClick(    View v){
      advancedDialog.dismiss();
    }
  }
);
  tips.setChecked(ep.getBoolean("String_Node_Str",false));
  cycle.setChecked(ep.getBoolean("String_Node_Str",false));
  ignoreEntries.setChecked(ep.getBoolean("String_Node_Str",false));
  useDay.setChecked(ep.getBoolean("String_Node_Str",false));
  rangeSound.setChecked(ep.getBoolean("String_Node_Str",false));
  jumpToPlot.setChecked(ep.getBoolean("String_Node_Str",false));
  barcodeScan.setChecked(ep.getBoolean("String_Node_Str",false));
  nextEmptyPlot.setChecked(ep.getBoolean("String_Node_Str",false));
  quickGoTo.setChecked(ep.getBoolean("String_Node_Str",false));
  disableShare.setChecked(ep.getBoolean("String_Node_Str",false));
  disableEntryNavLeft.setChecked(ep.getBoolean("String_Node_Str",false));
  disableEntryNavRight.setChecked(ep.getBoolean("String_Node_Str",false));
  dataGrid.setChecked(ep.getBoolean("String_Node_Str",false));
  tips.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      invalidateOptionsMenu();
      MainActivity.reloadData=true;
    }
  }
);
  cycle.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      MainActivity.reloadData=true;
    }
  }
);
  ignoreEntries.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      MainActivity.reloadData=true;
    }
  }
);
  useDay.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      MainActivity.reloadData=true;
    }
  }
);
  rangeSound.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      MainActivity.reloadData=true;
    }
  }
);
  jumpToPlot.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      MainActivity.reloadData=true;
    }
  }
);
  nextEmptyPlot.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      MainActivity.reloadData=true;
    }
  }
);
  quickGoTo.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      MainActivity.reloadData=true;
    }
  }
);
  disableShare.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      MainActivity.reloadData=true;
    }
  }
);
  disableEntryNavLeft.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      MainActivity.reloadData=true;
    }
  }
);
  disableEntryNavRight.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      MainActivity.reloadData=true;
    }
  }
);
  barcodeScan.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      MainActivity.reloadData=true;
    }
  }
);
  dataGrid.setOnCheckedChangeListener(new OnCheckedChangeListener(){
    public void onCheckedChanged(    CompoundButton arg0,    boolean checked){
      Editor e=ep.edit();
      e.putBoolean("String_Node_Str",checked);
      e.apply();
      MainActivity.reloadData=true;
    }
  }
);
  saveDialog=new Dialog(this,android.R.style.Theme_Holo_Light_Dialog);
  saveDialog.setTitle(getString(R.string.export));
  saveDialog.setContentView(R.layout.savefile);
  android.view.WindowManager.LayoutParams params2=saveDialog.getWindow().getAttributes();
  params2.width=LayoutParams.MATCH_PARENT;
  saveDialog.getWindow().setAttributes(params2);
  saveDialog.setCancelable(true);
  saveDialog.setCanceledOnTouchOutside(true);
  Button closeBtn=(Button)saveDialog.findViewById(R.id.closeBtn);
  closeBtn.setOnClickListener(new OnClickListener(){
    public void onClick(    View v){
      saveDialog.dismiss();
    }
  }
);
  exportFile=(EditText)saveDialog.findViewById(R.id.fileName);
  checkDB=(CheckBox)saveDialog.findViewById(R.id.formatDB);
  checkExcel=(CheckBox)saveDialog.findViewById(R.id.formatExcel);
  allColumns=(RadioButton)saveDialog.findViewById(R.id.allColumns);
  onlyUnique=(RadioButton)saveDialog.findViewById(R.id.onlyUnique);
  allTraits=(RadioButton)saveDialog.findViewById(R.id.allTraits);
  activeTraits=(RadioButton)saveDialog.findViewById(R.id.activeTraits);
  Button exportButton=(Button)saveDialog.findViewById(R.id.saveBtn);
  exportButton.setOnClickListener(new OnClickListener(){
    public void onClick(    View arg0){
      if (!checkDB.isChecked() & !checkExcel.isChecked()) {
        Toast.makeText(ConfigActivity.this,getString(R.string.noexportcheck),Toast.LENGTH_LONG).show();
        return;
      }
      if (!onlyUnique.isChecked() & !allColumns.isChecked()) {
        Toast.makeText(ConfigActivity.this,getString(R.string.nofieldcheck),Toast.LENGTH_LONG).show();
        return;
      }
      if (!activeTraits.isChecked() & !allTraits.isChecked()) {
        Toast.makeText(ConfigActivity.this,getString(R.string.notraitcheck),Toast.LENGTH_LONG).show();
        return;
      }
      newRange=new ArrayList<>();
      if (onlyUnique.isChecked()) {
        newRange.add(ep.getString("String_Node_Str","String_Node_Str"));
      }
      if (allColumns.isChecked()) {
        String[] columns=MainActivity.dt.getRangeColumns();
        Collections.addAll(newRange,columns);
      }
      exportTrait=new ArrayList<>();
      if (activeTraits.isChecked()) {
        String[] traits=MainActivity.dt.getVisibleTrait();
        Collections.addAll(exportTrait,traits);
      }
      if (allTraits.isChecked()) {
        String[] traits=MainActivity.dt.getAllTraits();
        Collections.addAll(exportTrait,traits);
      }
      checkDbBool=checkDB.isChecked();
      checkExcelBool=checkExcel.isChecked();
      exportFileString=exportFile.getText().toString();
      saveDialog.dismiss();
      mHandler.post(exportData);
    }
  }
);
  setupDialog=new Dialog(this,android.R.style.Theme_Holo_Light_Dialog);
  setupDialog.setTitle(getString(R.string.setup));
  setupDialog.setContentView(R.layout.config);
  params=setupDialog.getWindow().getAttributes();
  params.width=LayoutParams.MATCH_PARENT;
  params.height=LayoutParams.WRAP_CONTENT;
  setupDialog.getWindow().setAttributes(params);
  setupDialog.setCancelable(true);
  setupDialog.setCanceledOnTouchOutside(true);
  setupList=(ListView)setupDialog.findViewById(R.id.myList);
  Button setupCloseBtn=(Button)setupDialog.findViewById(R.id.closeBtn);
  setupCloseBtn.setOnClickListener(new OnClickListener(){
    public void onClick(    View v){
      setupDialog.dismiss();
    }
  }
);
  personDialog=new Dialog(this,android.R.style.Theme_Holo_Light_Dialog);
  personDialog.setTitle(getString(R.string.personsetup));
  personDialog.setContentView(R.layout.person);
  personDialog.setCancelable(true);
  personDialog.setCanceledOnTouchOutside(true);
  final EditText firstName=(EditText)personDialog.findViewById(R.id.firstName);
  final EditText lastName=(EditText)personDialog.findViewById(R.id.lastName);
  Button yesButton=(Button)personDialog.findViewById(R.id.saveBtn);
  yesButton.setOnClickListener(new OnClickListener(){
    public void onClick(    View arg0){
      Editor e=ep.edit();
      e.putString("String_Node_Str",firstName.getText().toString());
      e.putString("String_Node_Str",lastName.getText().toString());
      e.apply();
      updateSetupList();
      personDialog.dismiss();
    }
  }
);
  fieldDialog2=new Dialog(this,android.R.style.Theme_Holo_Light_Dialog);
  fieldDialog2.setTitle(getString(R.string.fields));
  fieldDialog2.setContentView(R.layout.config);
  fieldDialog2.setCancelable(true);
  fieldDialog2.setCanceledOnTouchOutside(true);
  Button fdCloseBtn2=(Button)fieldDialog2.findViewById(R.id.closeBtn);
  fdCloseBtn2.setOnClickListener(new OnClickListener(){
    public void onClick(    View v){
      fieldDialog2.dismiss();
    }
  }
);
  ListView settingsList=(ListView)findViewById(R.id.myList);
  Button mainCloseBtn=(Button)findViewById(R.id.closeBtn);
  mainCloseBtn.setVisibility(View.GONE);
  String[] items2=new String[]{getString(R.string.fields),getString(R.string.traits),getString(R.string.setup),getString(R.string.export),getString(R.string.advanced),getString(R.string.language)};
  settingsList.setOnItemClickListener(new OnItemClickListener(){
    public void onItemClick(    AdapterView<?> av,    View arg1,    int position,    long arg3){
      Intent intent=new Intent();
switch (position) {
case 0:
        intent.setClassName(ConfigActivity.this,FileExploreActivity.class.getName());
      intent.putExtra("String_Node_Str",Constants.FIELDIMPORTPATH);
    startActivityForResult(intent,1);
  break;
case 1:
if (!ep.getBoolean("String_Node_Str",false)) {
  makeToast(getString(R.string.importtraitwarning));
  return;
}
intent.setClassName(ConfigActivity.this,TraitEditorActivity.class.getName());
startActivity(intent);
break;
case 2:
if (!ep.getBoolean("String_Node_Str",false)) {
makeToast(getString(R.string.nofieldloaded));
return;
}
showSetupDialog();
break;
case 3:
if (!ep.getBoolean("String_Node_Str",false)) {
makeToast(getString(R.string.nofieldloaded));
return;
}
 else if (MainActivity.dt.getTraitColumnsAsString() == null) {
makeToast(getString(R.string.notraitloaded));
return;
}
showSaveDialog();
break;
case 4:
advancedDialog.show();
break;
case 5:
showLanguageDialog();
break;
}
}
}
);
ArrayAdapter<String> adapter=new ArrayAdapter<String>(this,R.layout.listitem,items2);
settingsList.setAdapter(adapter);
SharedPreferences.Editor ed=ep.edit();
if (ep.getInt("String_Node_Str",-1) < getVersion()) {
ed.putInt("String_Node_Str",getVersion());
ed.apply();
Intent intent=new Intent();
intent.setClass(ConfigActivity.this,ChangelogActivity.class);
startActivity(intent);
}
if (!ep.getBoolean("String_Node_Str",false)) {
ed.putBoolean("String_Node_Str",true);
ed.apply();
showTipsDialog();
}
}