[android] #2462 moving MapFragment into the SDK

This commit is contained in:
Tobrun
2015-10-08 10:08:58 +02:00
committed by Brad Leege
parent fd45a206ec
commit ba97c69845
3 changed files with 13 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
package com.mapbox.mapboxsdk.testapp;
package com.mapbox.mapboxsdk;
import android.os.Bundle;
import android.support.v4.app.Fragment;
@@ -7,9 +7,9 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.mapbox.mapboxsdk.utils.ApiAccess;
import com.mapbox.mapboxsdk.views.MapView;
// TODO move this to SDK
public class MapFragment extends Fragment {
//
@@ -40,7 +40,7 @@ public class MapFragment extends Fragment {
mMap = (MapView) inflater.inflate(R.layout.fragment_main, container, false);
// Set accessToken
mMap.setAccessToken(Util.getAccessToken(container.getContext()));
mMap.setAccessToken(ApiAccess.getToken(container.getContext()));
// Need to pass on any saved state to the map
mMap.onCreate(savedInstanceState);
@@ -110,6 +110,15 @@ public class MapFragment extends Fragment {
super.onSaveInstanceState(outState);
}
@Override
public void onLowMemory() {
Log.v(TAG, "OnLowMemory");
// Need to pass on to view
mMap.onLowMemory();
super.onLowMemory();
}
//
// Property methods
//

View File

@@ -9,6 +9,7 @@ import android.view.Gravity;
import android.view.MenuItem;
import android.view.View;
import com.mapbox.mapboxsdk.MapFragment;
import com.mapbox.mapboxsdk.geometry.LatLng;
import com.mapbox.mapboxsdk.views.MapView;