Questions tagged [mapfragment]

The Android Fragment that represents a Map component in an Android app.

240 questions
8
votes
5 answers

Binary XML file line #8: Error inflating class fragment, Google Maps

In this app, I am trying to add a functional V2 google map. I've looked at most of the tutorials for creating an activity, obtaining a key for the maps, and creating the xml file to try and see if I missed any step (I went through them like 4…
Sai Valluri
  • 147
  • 1
  • 2
  • 7
7
votes
4 answers

Binary XML file line #1: Error inflating class fragment MapFragment

I have a navigation drawer with some fragments. Each Fragment has a MapFragment in the layout. Initially, when the app runs the navigation drawer clicks open up the fragment once, but when I click the same navigation item to open up the same…
7
votes
4 answers

How to Hide Map Fragment - Android

Using below code to show and hide MapFragment, and it works just well: public class MapFragmentActivity extends FragmentActivity { ........... mMapFragment = ((SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map)); googleMap…
6
votes
2 answers

Android : MapView in a CollapsingToolbarLayout

I'm currently trying to put a Map View (or a fragment containing the map)inside a CollapsingToolbarLayout. I would want to have the parallax effect on it when the RecyclerView scrolls. Unfortunately, it isn't showing up at all! Not even the grey…
6
votes
2 answers

"MapFragment cannot be resolved to a type" even though I am on API level 17

I just started using MapFragments, and I can get the Map to show in my Activity. I just use a simple XML-layout, and it works as expected: Now, I need to get the Fragment in code, so I can start interacting with the Map. This is where I run into…
Ted
  • 19,727
  • 35
  • 96
  • 154
6
votes
2 answers

Performance of multiple MapFragments (Android Map API v2)

I searched the docs of the new Google Android Map API v2, but didn't find anything about it. Before v2 we (officially) couldn't properly display more than one map per application (process). I assume that with MapFragment implementation it's no…
Michał Klimczak
  • 12,674
  • 8
  • 66
  • 99
5
votes
0 answers

Application crash on startup when loading Mapview (java.lang.OutOfMemoryError: EnsureLocalCapacity)

Launching application after installation causes a crash only on Samsung phones. It does not occur on other phones. The error is java.lang.OutOfMemoryError: EnsureLocalCapacity: The crash only occurs when launching the application for the first…
5
votes
1 answer

MapFragment: bad performance after using the back button

I have a performance issue when using MapFragment together with the action bar menu. The bug emerges when three conditions are met Have a MapFragment instantiated. Trigger a fragment transaction from the options menu, replacing the map fragment…
Otto Allmendinger
  • 27,448
  • 7
  • 68
  • 79
5
votes
3 answers

Android MapFragment Runtime Error - Could not find class 'maps.j.k'

I'm using a SupportMapFragment with complete success. I'm not having any problems at all. However I'm getting an error during my app's runtime. I'm running on a Gingerbread Phone and it has the latest GooglePlay. Also note that I'm using…
5
votes
1 answer

Using mapfragment functionality offline

I am developing a tracking app, so I use the GPS data to draw a route + checkpoints in a canvas. The problem is, I developed zoom/drag+span in a SurfaceView and all the "lat-long to cartesian conversion", but it would be so much easy to do all this…
Sebastian Breit
  • 6,137
  • 1
  • 35
  • 53
4
votes
3 answers

Android MapFragment , unable to draw on map & unable to restore previous map state

I'm developing an app that has a app feature for displaying teams on Google maps as markers. I'm able to display myself as marker that updates when I move & others as markers on a fragment. The issue is markers are displayed ONLY THE 1st TIME that…
cyber101
  • 2,822
  • 14
  • 50
  • 93
4
votes
2 answers

Scale marker size on google map

How can I scale marker size in android google maps fragment, when zoom on map changes. Get same effect like uber has with cars.
pepela
  • 423
  • 5
  • 17
4
votes
1 answer

How to get two MapFragments in the same activity - Google Map Api

I need to display two MapFragments with two different locations in an activity. In my XML file I have two MapFragments called "map" and "map_two", and in java my code in onCreate is : com.google.android.gms.maps.MapFragment mapFragment =…
Alex9494
  • 1,588
  • 3
  • 12
  • 22
4
votes
4 answers

Google map crashing in few devices

My app is working fine in Moto G (Android 5.0.2) but crashing in Karbon spark (Android 5.1.1) and several other devices. This crash is due to MapFragment. Min skd is 17 so I am using MapFragment. AndroidManifest.xml
Shakeeb Ayaz
  • 6,200
  • 6
  • 45
  • 64
4
votes
1 answer

how to add mapfragment inside a listview item within adapter?

I have a list view. I want to add a map inside each list item. The map will show/hide when I click on the list item. When the map shows, I can zoom, view location detail... on it. But I can't set MapFragment in the adapter. So, give me some…
Tri Ngo Minh
  • 145
  • 1
  • 9
1
2
3
15 16