supportmapfragment

Google Maps Android API v2 SupportMapFragment memory leak

雨燕双飞 提交于 2019-11-27 23:13:20
问题 Using 2 simple activities. First Activity which only holds a button to start the 2nd Activity which holds the map: Main Activity: public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void goToMap(View view){ //This is just the onClick method for the button Intent intent=new Intent( this, BigMapTest.class); startActivity(intent); } The map activity: public

Android SupportMapFragment Exception Error

跟風遠走 提交于 2019-11-27 22:41:44
问题 I am trying to use the new Google Play Services Lib and embbed Maps in side the Maps Fragment as below PlaceMapsFragment.java public class PlaceMapsFragment extends SupportMapFragment { private GoogleMap mMap; private LatLng mPosFija; public PlaceMapsFragment() { super(); } public static PlaceMapsFragment newInstance(LatLng posicion) { PlaceMapsFragment frag = new PlaceMapsFragment(); frag.mPosFija = posicion; return frag; } @Override public GoogleMap getMap() { // TODO Auto-generated method

getMapAsync() in Fragment

拟墨画扇 提交于 2019-11-27 20:38:00
问题 I having trouble implementing Google Map in Fragment. This is my the part of my fragment class: public class FragmentStoreFinderMap extends Fragment implements OnMapReadyCallback { // Google Map private GoogleMap googleMap; private int i; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); googleMap = ((SupportMapFragment)getActivity().getSupportFragmentManager().findFragmentById( R.id.map)).getMapAsync(this); I am getting an error in getMapAsync

How to disable scrolling of AppBarLayout in CoordinatorLayout?

心已入冬 提交于 2019-11-27 12:25:06
I have MapFragment with parallax effect inside AppBarLayout : I want to disable scrolling on AppBarLayout , because it is not possible to move across map, since touch evenys on the map are always handled as scroll events. I would like to handle collapsing of AppBarLayout by scrolling RecyclerView only, which is on the bottom of the screen. This is my xml: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.AppBarLayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" android:theme="@style

SupportMapFragment.getmap() returns null

给你一囗甜甜゛ 提交于 2019-11-27 05:12:27
I'm trying to load SupportMapFragment dynamically in a fragment, here is my onCreateView() method: @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View contentView = inflater.inflate(R.layout.frag_map_layout, null); shopDtos=ShopListFragment.shopDtos; fragment =SupportMapFragment.newInstance(); FragmentTransaction ft = getFragmentManager().beginTransaction(); ft.replace(R.id.map_content, fragment); ft.commit(); map = fragment.getMap(); mapMarker = map.addMarker(new MarkerOptions().position(new LatLng(0, 0)) .icon

Android - SupportMapFragment with GoogleMaps API 2.0 giving IllegalArgumentException

走远了吗. 提交于 2019-11-26 18:46:32
I am trying to use the latest Map API 2.0 provided for Android. I am using the Support Library as I want to support Android 2.2. Following is my code: Main Activity class public class MainActivity extends FragmentActivity { public FragmentManager fManager ; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); fManager = getSupportFragmentManager(); Button showMapButton = (Button) findViewById(R.id.showMapButton); showMapButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) {

How to disable scrolling of AppBarLayout in CoordinatorLayout?

喜欢而已 提交于 2019-11-26 15:59:42
问题 I have MapFragment with parallax effect inside AppBarLayout : I want to disable scrolling on AppBarLayout , because it is not possible to move across map, since touch evenys on the map are always handled as scroll events. I would like to handle collapsing of AppBarLayout by scrolling RecyclerView only, which is on the bottom of the screen. This is my xml: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.AppBarLayout android:id="@+id/appbar" android:layout_width="match

How to show multiple markers on MapFragment in Google Map API v2?

耗尽温柔 提交于 2019-11-26 15:19:52
I am using Google Map API v2 in my application to show Maps. I have followed all the steps, that is to be followed to enable Google Map in my application. public class PinLocationOnMapView extends FragmentActivity { private double mLatitude = 0.0, mLongitude = 0.0; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); SupportMapFragment fragment = SupportMapFragment.newInstance(); getSupportFragmentManager().beginTransaction() .add(android.R.id.content, fragment).commit(); } } If I use this code, it shows me map, but if I provide my latitude

SupportMapFragment.getmap() returns null

拜拜、爱过 提交于 2019-11-26 12:47:11
问题 I\'m trying to load SupportMapFragment dynamically in a fragment, here is my onCreateView() method: @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View contentView = inflater.inflate(R.layout.frag_map_layout, null); shopDtos=ShopListFragment.shopDtos; fragment =SupportMapFragment.newInstance(); FragmentTransaction ft = getFragmentManager().beginTransaction(); ft.replace(R.id.map_content, fragment); ft.commit(); map = fragment

How to show multiple markers on MapFragment in Google Map API v2?

二次信任 提交于 2019-11-26 04:19:54
问题 I am using Google Map API v2 in my application to show Maps. I have followed all the steps, that is to be followed to enable Google Map in my application. public class PinLocationOnMapView extends FragmentActivity { private double mLatitude = 0.0, mLongitude = 0.0; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); SupportMapFragment fragment = SupportMapFragment.newInstance(); getSupportFragmentManager().beginTransaction() .add(android.R.id