use of com.peterlaurence.trekadvisor.core.map.gson.RouteGson in project TrekAdvisor by peterLaurence.
the class MapRouteImportTask method doInBackground.
@Override
protected Void doInBackground(Void... params) {
File routeFile = new File(mMap.getDirectory(), MapLoader.MAP_ROUTE_FILE_NAME);
if (!routeFile.exists())
return null;
String jsonString;
try {
jsonString = FileUtils.getStringFromFile(routeFile);
RouteGson routeGson = mGson.fromJson(jsonString, RouteGson.class);
mMap.setRouteGson(routeGson);
} catch (Exception e) {
/* Error while decoding the json file */
Log.e(TAG, e.getMessage(), e);
}
return null;
}