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

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

java - How to provide dependency injections in Eclipse RCP 3.x? -