diff options
Diffstat (limited to 'platform/android/MapboxGLAndroidSDKTestApp')
-rw-r--r-- | platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/GeoParseUtil.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/GeoParseUtil.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/GeoParseUtil.java index ed49a81dcf..cace2083da 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/GeoParseUtil.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/utils/GeoParseUtil.java @@ -1,6 +1,7 @@ package com.mapbox.mapboxsdk.testapp.utils; import android.content.Context; +import android.content.res.AssetManager; import android.text.TextUtils; import com.mapbox.geojson.Feature; @@ -23,9 +24,11 @@ public class GeoParseUtil { if (TextUtils.isEmpty(fileName)) { throw new NullPointerException("No GeoJSON File Name passed in."); } - try (InputStream is = context.getAssets().open(fileName)) { - BufferedReader rd = new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8"))); - return readAll(rd); + try (AssetManager as = context.getAssets()) { + try (InputStream is = as.open(fileName)) { + BufferedReader rd = new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8"))); + return readAll(rd); + } } } |