I am trying to add a
to the starterservice with InlineJava
The Class is using
internally. This is the code-block which fails.
CONTENT_FILE_NAME is a filename for a file in the assets
What do i need to rewrite the code to?
Can i enable -source 7 somehow?
B4X:
public static class StickerContentProvider extends ContentProvider
The Class is using
B4X:
private synchronized void readContentFile(@NonNull Context context) {
try (InputStream contentsInputStream = context.getAssets().open(CONTENT_FILE_NAME)) {
stickerPackList = ContentFileParser.parseStickerPacks(contentsInputStream);
} catch (IOException | IllegalStateException e) {
throw new RuntimeException(CONTENT_FILE_NAME + " file has some issues: " + e.getMessage(), e);
}
}
CONTENT_FILE_NAME is a filename for a file in the assets
B4X:
public static final String CONTENT_FILE_NAME = "contents.json";
B4A Version: 8.50
Parse den Code. (0.00s)
Building folders structure. (0.04s)
Kompiliere den Code. (0.01s)
Kompiliere Layoutcode. (0.00s)
Organisiere Libraries. (0.00s)
Generiere R Datei. (0.16s)
Kompiliere generierten Java Code. Error
javac 1.8.0_141
src\de\donmanfred\sticker\starter.java:320: error: try-with-resources is not supported in -source 1.6
try (InputStream contentsInputStream = context.getAssets().open(CONTENT_FILE_NAME)) {
^
(use -source 7 or higher to enable try-with-resources)
1 error
What do i need to rewrite the code to?
Can i enable -source 7 somehow?