Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
#103 - only remove an offline region if there is are any
Browse files Browse the repository at this point in the history
  • Loading branch information
tobrun committed Aug 9, 2016
1 parent d256bb8 commit 78bef60
Showing 1 changed file with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,20 @@ public void onPause() {
offlineManager.listOfflineRegions(new OfflineManager.ListOfflineRegionsCallback() {
@Override
public void onList(OfflineRegion[] offlineRegions) {
if (offlineRegions.length > 0) {
// delete the last item in the offlineRegions list which will be yosemite offline map
offlineRegions[(offlineRegions.length - 1)].delete(new OfflineRegion.OfflineRegionDeleteCallback() {
@Override
public void onDelete() {
Toast.makeText(SimpleOfflineMapActivity.this, "Yosemite offline map deleted", Toast.LENGTH_LONG).show();
}

// delete the last item in the offlineRegions list which will be yosemite offline map
offlineRegions[(offlineRegions.length - 1)].delete(new OfflineRegion.OfflineRegionDeleteCallback() {
@Override
public void onDelete() {
Toast.makeText(SimpleOfflineMapActivity.this, "Yosemite offline map deleted", Toast.LENGTH_LONG).show();
}

@Override
public void onError(String error) {
Log.e(TAG, "On Delete error: " + error);
}
});
@Override
public void onError(String error) {
Log.e(TAG, "On Delete error: " + error);
}
});
}
}

@Override
Expand Down

0 comments on commit 78bef60

Please sign in to comment.