Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

[android] Refactor layer/source ownership - #6997

Merged
ivovandongen merged 4 commits into
masterfrom
ivovandongen-android-style-ownership
Nov 11, 2016
Merged

ivovandongen merged 4 commits into
masterfrom
ivovandongen-android-style-ownership

Conversation

@ivovandongen

Copy link
Copy Markdown
Contributor

Fixes #6995

Should be ported to the 4.2.0 release branch as well.

cc @jfirebaugh @tobrun

@ivovandongen ivovandongen added the Android Mapbox Maps SDK for Android label Nov 10, 2016
@ivovandongen ivovandongen added this to the android-v4.2.0 milestone Nov 10, 2016
@ivovandongen ivovandongen self-assigned this Nov 10, 2016
@mention-bot

Copy link
Copy Markdown

@ivovandongen, thanks for your PR! By analyzing the history of the files in this pull request, we identified @bleege, @tobrun and @incanus to be potential reviewers.

@ivovandongen
ivovandongen force-pushed the ivovandongen-android-style-ownership branch from 13df63a to 825099a Compare November 10, 2016 12:27
@ivovandongen ivovandongen mentioned this pull request Nov 10, 2016
@tobrun

tobrun commented Nov 11, 2016 •

Copy link
Copy Markdown
Member

I was able to make it crash with:

java.lang.NullPointerException: Attempt to invoke virtual method 'com.mapbox.mapboxsdk.style.sources.Source com.mapbox.mapboxsdk.maps.NativeMapView.getSource(java.lang.String)' on a null object reference
at com.mapbox.mapboxsdk.maps.MapboxMap.getSourceAs(MapboxMap.java:159)
at com.mapbox.mapboxsdk.testapp.activity.style.RuntimeStyleActivity$3.run(RuntimeStyleActivity.java:355)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5515)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:764)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:654)

Which points to:

 GeoJsonSource source = mapboxMap.getSourceAs("dynamic-park-source");

Seeing this line in this PR makes me think we need to update that example code as well?

update: isn't reproducible on demand.

@ivovandongen

Copy link
Copy Markdown
Contributor Author

@tobrun This is a separate issue where the animation is not killed properly on closing the Activity.

@ivovandongen
ivovandongen merged commit 1beb28e into master Nov 11, 2016
@ivovandongen
ivovandongen deleted the ivovandongen-android-style-ownership branch November 11, 2016 12:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Android Mapbox Maps SDK for Android

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants