java - Error inflating map View -


Map tap point exception error is having trouble loading the map in my piece. It always seems redundant I have tried to load this scene in different ways, but still seems to get a blank map.

  08-01 12: 41: 1 9: 42: E / Android Rendime (25728): Process: com.ideamovingand delivery, PID: 25728 08-01 December: 41: 19.349: e / AndroidRuntime (25,728): java.lang.NullPointerException 08-01 December: 41: 19.349: e / AndroidRuntime (25,728): to com.idealmovinganddelivery.mapfragment.MapsFragment.setUpMapIfNeeded (MapsFragment.java:122) 08-01 December: 41 : 19.349:   

the main activity

  The main activity of the public class is that ActionBarActivity implements ActionBar.TabListener, MapDialogFragment.MapDialogListener {@Override Public Dose on Zero Aylog Positivik (DialogFragment dialog, string) {MapsFragment mapFrag = (MapsFragment) getSupportFragmentManager () findFragmentById (R.id.map); MapFrag.addDeliveryPoint (address); }  

Fragment_map XML

  & lt; Relative layout xmlns: Android = "http://schemas.android.com/apk/res/android" xmlns: tool = "http://schemas.android.com/tools" Android: id = "@ + id / fragment_map_layout "Android: layout_width =" match_parent "Android: layout_height =" match_parent "tool: reference =" com.idealmovinganddelivery.MainActivity "& Gt; & Lt; Piece android: id = "@ + id / map" Android: layout_width = "fill_parent" Android: layout_height = "fill_parent" class = "com.idealmovinganddelivery.mapfragment.MapsFragment" / & gt; & Lt; / RelativeLayout & gt;  

Show Piece

  implements public square MapsFragment extends SupportMapFragment SearchView.OnQueryTextListener, OnMarkerClickListener {public view onCreateView (LayoutInflater inflater, ViewGroup container, bundle savedInstanceState) { Super .onCreateView (inflater, container, savedInstanceState); SetHasOptionsMenu (true); See = inflater.inflate (R.layout.fragment_map, container, incorrect); Return view; } Public static zero setUpMapIfNeeded () {// Make a blank check to confirm that we have not already installed the map If try (map == null) {// Get a map from SupportMapFragment. Map = ((SupportMapFragment) MainActivity.fragmentManager.findFragmentById (R.id.map)). GetMap (); // Check that we have been able to get the map. If (map! = Tap) setUpMap (); }}  

The error is correct here from SupportMapFragment Code> MapsFragment can not be inserted.

At that point where you are performing this artist, you are getting a view with the ID R.id.map . You have defined it in your XML file that here is the SupportMapFragment type:

  class = "com.google.android.gms.maps.SupportMapFragment"  

Use your SupportMapFragment subclass, MapsFragment instead of

  to  & lt; Fragment & gt;  element must define piece android: id = "@ + id / map" Android: layout_width = "fill_parent" Android: layout_height = "fill_parent" class = "com.idealmovinganddelivery.mapfragment.MapsFragment" / & gt;  

Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -