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

Commit

Permalink
onDestroy adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
langsmith committed Aug 21, 2018
1 parent 74f1fc2 commit f9c9d6e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion MapboxAndroidDemo/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,8 @@
</activity>
<activity
android:name=".examples.styles.TransparentBackgroundActivity"
android:label="@string/activity_styles_transparent_background_title">
android:label="@string/activity_styles_transparent_background_title"
android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.mapbox.mapboxandroiddemo.MainActivity" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
import timber.log.Timber;

/**
* Create a transparent render surface and add whatever you want. This example has a moving water.
* Create a transparent render surface and add whatever you want to the background. This example
* has a video of moving water behind Earth's land.
*/
public class TransparentBackgroundActivity extends AppCompatActivity implements OnMapReadyCallback {

Expand Down Expand Up @@ -106,11 +107,11 @@ public void onLowMemory() {

@Override
protected void onDestroy() {
super.onDestroy();
mapView.onDestroy();
if(null!=backgroundWaterVideoView){
if (backgroundWaterVideoView != null) {
backgroundWaterVideoView.stopPlayback();
}
super.onDestroy();
mapView.onDestroy();
}

@Override
Expand All @@ -119,6 +120,9 @@ protected void onSaveInstanceState(Bundle outState) {
mapView.onSaveInstanceState(outState);
}

/**
* Get the map style JSON from the raw file in the app's raw folder
*/
public static String readRawResource(Context context, @RawRes int rawResource) throws IOException {
String json = "";
if (context != null) {
Expand Down

0 comments on commit f9c9d6e

Please sign in to comment.