Source:
<code>private void createTable() { TableRow row; List<OperationParameter> operationParameters = operation.getOperationProperties().getOperationParameters(); if (operationParameters != null) { for (OperationParameter operationParameter : operationParameters) { switch (operationParameter.getType()) { case "string": { row = (TableRow) LayoutInflater.from(getActivity()).inflate(R.layout.row_edit, null); EditText data = (EditText) row.findViewById(R.id.data); data.setText(operationParameter.getDefaultValue()); data.setInputType(InputType.TYPE_CLASS_TEXT); break; } case "int": { row = (TableRow) LayoutInflater.from(getActivity()).inflate(R.layout.row_edit, null); EditText data = (EditText) row.findViewById(R.id.data); data.setText(operationParameter.getDefaultValue()); data.setInputType(InputType.TYPE_CLASS_NUMBER); break; } case "float": { row = (TableRow) LayoutInflater.from(getActivity()).inflate(R.layout.row_edit, null); EditText data = (EditText) row.findViewById(R.id.data); data.setText(operationParameter.getDefaultValue()); data.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL); break; } <START> default: { <END> row = (TableRow) LayoutInflater.from(getActivity()).inflate(R.layout.row_toggle, null); SwitchCompat data = (SwitchCompat) row.findViewById(R.id.data); data.setChecked(operationParameter.getDefaultValue().equals("true")); break; } } TextView name = (TextView) row.findViewById(R.id.name); name.setText(operationParameter.getName()); table.addView(row); } table.requestLayout(); } }</code><technical_language>I guess this is meant for boolean. this explicit case "boolean": default for cases incoming data is known. is works, is obvious read code</technical_language>

Target:
private void createTable() { TableRow row = null; List<OperationParameter> operationParameters = operation.getOperationProperties().getOperationParameters(); if (operationParameters != null) { for (OperationParameter operationParameter : operationParameters) { switch (operationParameter.getType()) { case "string": { row = (TableRow) LayoutInflater.from(getActivity()).inflate(R.layout.row_edit, null); EditText data = (EditText) row.findViewById(R.id.data); data.setText(operationParameter.getDefaultValue()); data.setInputType(InputType.TYPE_CLASS_TEXT); break; } case "int": { row = (TableRow) LayoutInflater.from(getActivity()).inflate(R.layout.row_edit, null); EditText data = (EditText) row.findViewById(R.id.data); data.setText(operationParameter.getDefaultValue()); data.setInputType(InputType.TYPE_CLASS_NUMBER); break; } case "float": { row = (TableRow) LayoutInflater.from(getActivity()).inflate(R.layout.row_edit, null); EditText data = (EditText) row.findViewById(R.id.data); data.setText(operationParameter.getDefaultValue()); data.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL); break; } case "bool": { row = (TableRow) LayoutInflater.from(getActivity()).inflate(R.layout.row_toggle, null); SwitchCompat data = (SwitchCompat) row.findViewById(R.id.data); data.setChecked(operationParameter.getDefaultValue().equals("true")); break; } } if (row != null) { TextView name = (TextView) row.findViewById(R.id.name); name.setText(operationParameter.getName()); table.addView(row); } } table.requestLayout(); } }