mapfragment

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

白昼怎懂夜的黑 提交于 2019-12-10 04:22:51
问题 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 problems: As you can see, the MapFragment (or getFragmentManager) cannot be resolved to a type. I am targeting Android 4, API level 17: and you can also see that I am referencing the Googke Play library. Here is the Manifest, just for clarity: So, the

Performance of multiple MapFragments (Android Map API v2)

早过忘川 提交于 2019-12-09 18:10:23
问题 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 longer an issue. I also know, that Fragments can be self-contained since API 17. And, last but not least, there is compatibility package, which makes it possible to port it all back to at least API 8 (in API 7, there's no OpenGL 2.0 so the maps wouldn't

how to add mapfragment inside a listview item within adapter?

南楼画角 提交于 2019-12-07 08:55:13
问题 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 solutions. Thank you. gMap = (MapFragment) getFragmentManager().findFragmentById(R.id.map); googleMap = gMap.getMap(); I can't do that in getView. 回答1: I just went through a similar problem and I came up with the following solution. By the way, now play

Google Maps API V2 android app on API level 8 up to 17

流过昼夜 提交于 2019-12-06 11:40:51
问题 I am working with the Google maps API V2 and it is going fine. i have a 2.2.2 android device wich i use to debug my app. now i just got a Galaxy Note 2, and when i try to debug on that device the app imidiatly crashed "project has stopped working". So i just made a small example to test with. and again it runs great on 2.2.2 but not on 4.1.1. this is the code i have for the small example exercise Any suggestions would be much appreciated My Layout <RelativeLayout xmlns:android="http://schemas

How do I get the coordinates of a map on tap with MapFragment (not MapView)?

霸气de小男生 提交于 2019-12-05 17:01:35
问题 I have searched around on how to get the coordinates of a location when the map is tapped. However, most, if not all the examples require a MapView as a parameter. For example: public boolean onTap(GeoPoint p, MapView map){ if ( isPinch ){ return false; }else{ Log.i(TAG,"TAP!"); if ( p!=null ){ handleGeoPoint(p); return true; // We handled the tap }else{ return false; // Null GeoPoint } } } @Override public boolean onTouchEvent(MotionEvent e, MapView mapView) { int fingers = e.getPointerCount

how to add mapfragment inside a listview item within adapter?

一世执手 提交于 2019-12-05 13:31:25
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 solutions. Thank you. gMap = (MapFragment) getFragmentManager().findFragmentById(R.id.map); googleMap = gMap.getMap(); I can't do that in getView. I just went through a similar problem and I came up with the following solution. By the way, now play services has google map lite mode. You can see the entire example at: https://github.com/vinirll/MapListView

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

烂漫一生 提交于 2019-12-05 08:11:16
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 problems: As you can see, the MapFragment (or getFragmentManager) cannot be resolved to a type. I am targeting Android 4, API level 17: and you can also see that I am referencing the Googke Play library. Here is the Manifest, just for clarity: So, the big question is: why can't I resolve MapFragment? What am I missing? As a side note:

Differences between MapView, MapFrament and SupportMapFragment

六月ゝ 毕业季﹏ 提交于 2019-12-04 18:21:52
问题 I would know the differences because I'm developing an app and I would introduce Google Map API v2 for compiling above Android 2.3. Which should I use? 回答1: MapView: A View which displays a map (with data obtained from the Google Maps service). When focused, it will capture key-presses and touch gestures to move the map. Users of this class must forward all the life cycle methods from the Activity or Fragment containing this view to the corresponding ones in this class. Use it if you are

Google Maps API V2 android app on API level 8 up to 17

☆樱花仙子☆ 提交于 2019-12-04 16:02:59
I am working with the Google maps API V2 and it is going fine. i have a 2.2.2 android device wich i use to debug my app. now i just got a Galaxy Note 2, and when i try to debug on that device the app imidiatly crashed "project has stopped working". So i just made a small example to test with. and again it runs great on 2.2.2 but not on 4.1.1. this is the code i have for the small example exercise Any suggestions would be much appreciated My Layout <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width=

Performance of multiple MapFragments (Android Map API v2)

雨燕双飞 提交于 2019-12-04 05:18:40
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 longer an issue. I also know, that Fragments can be self-contained since API 17. And, last but not least, there is compatibility package, which makes it possible to port it all back to at least API 8 (in API 7, there's no OpenGL 2.0 so the maps wouldn't work afaik). Sa I have all the ingredients to port my app to Maps API v2 and implement the following