Skip to content

Commit

Permalink
Fix importing of tt files on newer versions of android
Browse files Browse the repository at this point in the history
  • Loading branch information
beqabeqa473 committed Oct 4, 2023
1 parent 5b511fd commit 0b4b54d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Version 5.15, unreleased
Default Qt Client
-
Android Client
- Fixed importing of tt files on newer android versions
-
iOS Client
-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.util.Collections;
import java.util.Comparator;
Expand Down Expand Up @@ -256,11 +258,15 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
StringBuilder xml = new StringBuilder();
try {
String line;
BufferedReader source = new BufferedReader(new FileReader(AbsolutePathHelper.getRealPath(this.getBaseContext(), data.getData())));
while ((line = source.readLine()) != null) {
xml.append(line);
InputStream inputStream = this.getContentResolver().openInputStream(data.getData());
if (inputStream != null) {
BufferedReader source = new BufferedReader(new InputStreamReader(inputStream));
while ((line = source.readLine()) != null) {
xml.append(line);
}
source.close();
inputStream.close();
}
source.close();
}
catch (Exception ex) {
}
Expand Down

0 comments on commit 0b4b54d

Please sign in to comment.