android - Initialisation of MapFragment in Activity Failing -


i use following xml code create mapfragment:

<fragment     android:id="@+id/map"     android:name="com.google.android.gms.maps.supportmapfragment"     android:layout_width="match_parent"     android:layout_height="match_parent"     tools:context="com.hashcoder.eegoomain.customerhomeactivity"/> 

and in oncreate() method, use following code initialize map:

protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.activity_customer_home);     createnavigationdrawerfunction();     mapfragment = (supportmapfragment) getsupportfragmentmanager()             .findfragmentbyid(r.id.map);     mapfragment.getmapasync(this);  } 

but, when run code on phone (redmi note 4), shows following exception:

java.lang.runtimeexception: unable start activity componentinfo{com.hashcoder.eegoomain/com.hashcoder.eegoomain.customerhomeactivity}: android.view.inflateexception: binary xml file line #61: binary xml file line #61: error inflating class fragment 

and code works fine in other devices. doing wrong?


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -