supportmapfragment

SupportMapFragment Instead of MapFragment

岁酱吖の 提交于 2019-12-12 07:22:10
问题 I want to make an android application that uses Google Maps for Android v2. I can show a map. I can even navigate and zoom. But, when I want to search for more operations to make, I can't find any. I want this application to work on API level 8 and above. So, I used SupportMapFragment . I heard that, if I want to make my application to work on API level 8 and above, I have to use SupporMapFragment . I found examples about MapFragment s, but unfortunately, not about SupportMapFragment . I want

Getting java.lang.NullPointerException in MapFragment

梦想与她 提交于 2019-12-11 19:35:26
问题 I am using GoogleMaps in my application. For that purpose, I have implemented SupportMapFragment Map-v2 in my custom Fragment class. But unfortunately I am getting NullPointerException for no reasons in the lines SupportMapFragment fm = ((SupportMapFragment) getActivity ().getSupportFragmentManager ().findFragmentById (R.id.map)); googleMap = fm.getMap(); I really dont know what to do and I am completely helpless. I even referred few similar questions from link 1, link 2 and link 3. But

Get Map view instance from a Fragment

久未见 提交于 2019-12-11 16:47:12
问题 I have a MainFragment that consist of two fragments, a MapFragment and a ListFragment and this is its layout: MainFragment Layout: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:map="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" > <RelativeLayout android:layout_width="match

How to image from url into InfoWindowAdapter android?

非 Y 不嫁゛ 提交于 2019-12-11 10:01:52
问题 I'm trying to display an image from a url in a "InfoWindowAdapter" ,I have the following code, but does not show me the image .... mMap = getMap(); mMap.setInfoWindowAdapter(new InfoWindowAdapter() { ... @Override public View getInfoContents(Marker marker) { View v = getActivity().getLayoutInflater().inflate( R.layout.info_window_layout, null); String image_url = "http://api.androidhive.info/images/sample.jpg"; new DownloadImageTask(imgEquipo).execute(image_url); return v; } }); call to

Android - SupportMapFragment error when opening for second time

半世苍凉 提交于 2019-12-11 02:14:36
问题 I'm using Fragment(with TabHost) in my application. When opening my SupportMapFragment (Android maps v2) for a second time, I get the following error: FATAL EXCEPTION: main android.view.InflateException: Binary XML file line #48: Error inflating class fragment at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) at android.view.LayoutInflater.rInflate(LayoutInflater.java:746) at android.view.LayoutInflater.inflate(LayoutInflater.java:489) at android.view.LayoutInflater

NullPointerException using SupportMapFragment

杀马特。学长 韩版系。学妹 提交于 2019-12-11 01:34:49
问题 I'm trying to resolve this issue for some days. I'm vorking with GoogleMaps and SupportMapFragment. When I launch my app, log show this error and my app crash. Here is my log cat: 12-05 11:16:03.437 6931-6931/it.home.dressgallery E/dalvikvm﹕ Could not find class 'android.app.Notification$Builder', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.showErrorNotification 12-05 11:16:08.406 6931-6931/it.home.dressgallery E/dalvikvm﹕ Could not find class 'android.app

SupportMapFragment on a tab. I can only see once

房东的猫 提交于 2019-12-10 18:36:38
问题 I'm working on a tabbed application using FragmentTabHost. One of my tabs(Fragments) is a map (extends Fragment), and I can only see the first time I select it, If I select other tab and back to map, app crashes... The app must be compatible with API8 Main activity package pack.unimaps2; import com.google.android.gms.common.GooglePlayServicesUtil; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentTabHost; import android.view.Menu;

NullPointerException at mapFragment.getMapAsync

扶醉桌前 提交于 2019-12-10 14:59:48
问题 After going through SO questions relating to my title, I couldn't find a solution to the problem. I am having a NullPointerException at mapFragment.getMapAsync . Below is my MapActivity code. package com.example.jerofad.mylocation; import android.app.FragmentManager; import android.support.v4.app.FragmentActivity; import android.os.Bundle; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.OnMapReadyCallback

Failure saving state: active SupportMapFragment{} has cleared index: -1

这一生的挚爱 提交于 2019-12-10 13:35:28
问题 I am using supportMapFragment inside fragment this why I am using this.getChildFragmentManager() if this wrong please guide me public static ClinicFragment newInstance() { ClinicFragment fragment = new ClinicFragment(); return fragment; } @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); setTargetFragment(null , -1); // one of my tries } @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle

Only first map is showing with Multiple SupportMapFragment in ViewPager

我是研究僧i 提交于 2019-12-08 05:46:00
问题 Background I have a viewpager with three fragments. All the fragments are the new instance of the same fragment class that uses custom map layout or listview depending on the App Settings. But the problem only in map mode. Problem Every time I start viewpager activity in the map mode only current fragment shows the map. Other fragments are empty. Looks like all the fragments uses the only instance of map. And current fragment get this map first. Maps in other two fragments are null.