I am trying to use the android map to locate the specified address. I am able to locate and mark the address on map for the first time successfully. But when I try to locate the another address it throws an Exception in the fragment :
Binary XML file line #1: Error inflating class fragment
axml layout:
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/myMap"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.MapFragment" />
The problem is that when the fragment is replaced for the second time to locate new address, android is unable to inflate from axml. It crashes on line:
view = inflater.Inflate(Resource.Layout.map_layout, null);
I gone through these links, but could find the solution:
Android map v2 error on second inflating
Android - SupportMapFragment error when openning for second time
https://forums.xamarin.com/discussion/7378/google-maps-wont-work-error-on-fragmenttransaction
I also tried using SupportMapFragment
, behaviour is same.