From f2784c01afe010779cf12499bcff2fb49de71cba Mon Sep 17 00:00:00 2001 From: Marc Nause Date: Tue, 4 Feb 2020 20:11:30 +0100 Subject: [PATCH] Fixes #2008 Fixes crash which occurred in Create Config File on devices with API level < 26 --- .../main/java/io/pslab/activity/CreateConfigActivity.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/pslab/activity/CreateConfigActivity.java b/app/src/main/java/io/pslab/activity/CreateConfigActivity.java index b93035762..d083f19f7 100644 --- a/app/src/main/java/io/pslab/activity/CreateConfigActivity.java +++ b/app/src/main/java/io/pslab/activity/CreateConfigActivity.java @@ -15,6 +15,8 @@ import android.widget.EditText; import android.widget.Spinner; +import org.apache.commons.lang3.StringUtils; + import java.io.File; import java.io.FileWriter; import java.io.IOException; @@ -99,7 +101,7 @@ public void onClick(View v) { interval = intervalEditText.getText().toString(); if (interval.length() == 0) { CustomSnackBar.showSnackBar(findViewById(android.R.id.content), - getString(R.string.no_interval_message),null,null, Snackbar.LENGTH_SHORT); + getString(R.string.no_interval_message), null, null, Snackbar.LENGTH_SHORT); } else { ArrayList selectedParamsList = new ArrayList<>(); for (int i = 0; i < paramsListContainer.getChildCount(); i++) { @@ -184,7 +186,7 @@ private void createConfigFile(ArrayList params) { FileWriter writer = new FileWriter(configFile); writer.write("instrument: " + instrumentName + "\n"); writer.write("interval: " + interval + " " + intervalUnit + "\n"); - String param = String.join(",", params); + String param = StringUtils.join(",", params); writer.write("params: " + param); writer.flush(); writer.close();