diff --git a/Client/TeamTalkAndroid/src/main/java/dk/bearware/gui/ServerListActivity.java b/Client/TeamTalkAndroid/src/main/java/dk/bearware/gui/ServerListActivity.java index ed82830804..4002826dbd 100644 --- a/Client/TeamTalkAndroid/src/main/java/dk/bearware/gui/ServerListActivity.java +++ b/Client/TeamTalkAndroid/src/main/java/dk/bearware/gui/ServerListActivity.java @@ -256,9 +256,8 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) { case REQUEST_IMPORT_SERVERLIST : { if(resultCode == RESULT_OK) { StringBuilder xml = new StringBuilder(); - try { + try (InputStream inputStream = this.getContentResolver().openInputStream(data.getData());){ String line; - InputStream inputStream = this.getContentResolver().openInputStream(data.getData()); if (inputStream != null) { BufferedReader source = new BufferedReader(new InputStreamReader(inputStream)); while ((line = source.readLine()) != null) {