supportmapfragment

Maps Android V2: java.lang.noclassdeffounderror: com.google.android.gms.R$styleable

流过昼夜 提交于 2019-12-23 03:21:59
问题 As many I get the following error: java.lang.noclassdeffounderror: com.google.android.gms.R$styleable when trying to implement Maps for Android V2. Somehow I must be missing what I exactly am doing wrong, since it's not working. What I tried first is to copy the google-play-services.lib into the lib folder, but I saw somewhere I shouldn't do this. Then I tried to import addon-google_apis-google-8 as a project, but the project gives the error The import com.google cannot be resolved. I'm

SupportMapFragment vs MapFragment performance-wise

橙三吉。 提交于 2019-12-22 08:06:28
问题 Are there any differences between SupportMapFragment and MapFragment? In the reference it says that you should only use MapFragment when you target Android API level 12 and higher, but are there any other differences? Is one of them faster? 回答1: Are there any differences between SupportMapFragment and MapFragment? One begins with the word "Support". :-) Beyond that, MapFragment inherits from android.app.Fragment , which SupportMapFragment inherits from android.support.v4.app.Fragment . In the

MapFragment causing NullPointerException at getMapAsync(this) method

流过昼夜 提交于 2019-12-22 04:04:31
问题 I have implemented an activity which adds MapFragment at run time. The MapFragment xml has static fragment and I'm trying to get add at run time. Also I found there are some issues in Lollipop adding the map fragment at runtime. Kindly check Issue raised and temporary solution I have also given my codes below, fragment_map.xml <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android

getSupportFragmentManager() method is undefined for type MapFragment

依然范特西╮ 提交于 2019-12-21 02:49:12
问题 I'm trying to implement Google Map display and below are my codes: package com.fragments; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.SupportMapFragment; public class MapFragment extends SherlockMapFragment { private GoogleMap mMap; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)

Android - SupportMapFragment with GoogleMaps API 2.0 giving IllegalArgumentException

淺唱寂寞╮ 提交于 2019-12-17 04:27:16
问题 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

Android Google Maps API v2 - NoSuchFieldError

我的梦境 提交于 2019-12-13 07:17:09
问题 I am working on a project using Google Maps v2 for Android and I am getting a NoSuchFieldError while instantiating the Google map fragment on a rooted HTC Desire HD. Afaik, the issue should not be caused by Google Play Services not being installed on the device (event though they are and other applications using Google Maps v2 are working). I have tried making a check to see if Google Play Services library is installed on the device (by calling GooglePlayServicesUtil

NullPointerException whilst trying to add polyline/marker to a GoogleMap

谁说我不能喝 提交于 2019-12-13 04:25:25
问题 I have a SupportMapFragment with a GoogleMap object (which I have manipulated already using a GoogleMapOptions) and it is displaying/functioning fine, until I call getMap().addPolyline(...) where I get a NullPointerException. Here is my layout xml for the Activity: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <TextView android:id="@+id

changing the position of google maps SupportMapFragment Zoom and My location controls not work

ぃ、小莉子 提交于 2019-12-13 03:46:13
问题 I'm trying to change the zoom & my location controls positions in Android Google maps. I want to set zoom control position at the right bottom and set my location position at the left bottom of MapFragment (I'm using the com.google.android.gms.maps.SupportMapFragment ). Here is my map fragment layout: <fragment android:id="@+id/map" android:layout_below="@+id/toolbar" class="com.google.android.gms.maps.SupportMapFragment" android:layout_width="match_parent" android:layout_height="match_parent

Error inflating class fragment with SupportMapFragment

假装没事ソ 提交于 2019-12-12 09:23:53
问题 Here is yet another “Error inflating class fragment with SupportMapFragment” issue. Here is my fragment XML: <fragment xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/map" class="com.google.android.gms.maps.SupportMapFragment" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.myapp.maptest.MapsActivity" /> Here is my activity (it is started from a NavigationDrawer in the main

SupportMapFragment appearing blank (Map Google V2)

心不动则不痛 提交于 2019-12-12 08:14:46
问题 I want to load a SupportMapFragment in a Fragment container. I get no errors, my API Key is fine, Google Play Services Library is imported and all permissions are called. I call the MapFragment this way: MapaFragment fragment = new MapaFragment(); FragmentTransaction ft2 = getFragmentManager().beginTransaction(); ft2.replace(android.R.id.tabcontent, fragment) .commit(); The Fragment is as follows: public class MapaFragment extends SupportMapFragment { private View v; @Override public View