Skip to content

Commit

Permalink
Prevent an exception on lifecycle events
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Oct 4, 2016
1 parent eca5277 commit 87212d7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.2.0",
"version": "1.2.1",
"name": "cordova-plugin-mapbox",
"cordova_name": "Mapbox",
"description": "Need native maps? Look no further!",
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-plugin-mapbox"
version="1.2.0">
version="1.2.1">

<name>Mapbox</name>

Expand Down
12 changes: 9 additions & 3 deletions src/android/Mapbox.java
Original file line number Diff line number Diff line change
Expand Up @@ -488,14 +488,20 @@ public void onRequestPermissionResult(int requestCode, String[] permissions, int
}

public void onPause(boolean multitasking) {
mapView.onPause();
if (mapView != null) {
mapView.onPause();
}
}

public void onResume(boolean multitasking) {
mapView.onResume();
if (mapView != null) {
mapView.onResume();
}
}

public void onDestroy() {
mapView.onDestroy();
if (mapView != null) {
mapView.onDestroy();
}
}
}

0 comments on commit 87212d7

Please sign in to comment.