Getting this error android.view.InflateException: Binary XML file line #2: Error inflating class <unknown> -


am new android one facing error after adding linear layout fragment in main layout. before working fine fragment using 5.5" device test app.

07-22 19:48:01.775  28504-28504/com.milkywaygalaxy.mymaps e/androidruntime﹕ fatal exception: main process: com.milkywaygalaxy.mymaps, pid: 28504 java.lang.runtimeexception: unable start activity componentinfo{com.milkywaygalaxy.mymaps/com.milkywaygalaxy.mymaps.mapsactivity}: android.view.inflateexception: binary xml file line #2: error inflating class <unknown>         @ android.app.activitythread.performlaunchactivity(activitythread.java:2198)         @ android.app.activitythread.handlelaunchactivity(activitythread.java:2247)         @ android.app.activitythread.access$800(activitythread.java:141)         @ android.app.activitythread$h.handlemessage(activitythread.java:1210)         @ android.os.handler.dispatchmessage(handler.java:102)         @ android.os.looper.loop(looper.java:136)         @ android.app.activitythread.main(activitythread.java:5050)         @ java.lang.reflect.method.invokenative(native method)         @ java.lang.reflect.method.invoke(method.java:515)         @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:806)         @ com.android.internal.os.zygoteinit.main(zygoteinit.java:622)         @ dalvik.system.nativestart.main(native method) 

this new linear layout

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:paddingbottom="@string/verical_margin" android:paddingleft="@string/horizondal_margin" android:paddingright="@string/horizondal_margin" android:paddingtop="@string/verical_margin" >  <linearlayout     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:orientation="horizontal" >      <textview         android:id="@+id/textview1"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_gravity="start|center_vertical"         android:text="@string/location"         android:textsize="20sp" />      <edittext         android:id="@+id/edittext1"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_gravity="center|center_vertical"         android:ems="10" >          <requestfocus />     </edittext>      <button         android:id="@+id/button1"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_gravity="end|center_vertical"         android:text="@string/go"         android:onclick="geolocate"/> </linearlayout>  <fragment     android:id="@+id/map"     android:name="com.google.android.gms.maps.supportmapfragment"     android:layout_width="match_parent"     android:layout_height="fill_parent" />  </linearlayout> 

this main activity java code

public class mainactivity extends fragmentactivity {  private static final int gps_errordialog_request = 9001; googlemap mmap;  @suppresswarnings("unused") private static final double seattle_lat = 47.60621, seattle_lng =-122.33207,  sydney_lat = -33.867487, sydney_lng = 151.20699,  newyork_lat = 40.714353,  newyork_lng = -74.005973; private static final float defaultzoom = 15; private static final string logtag = "maps";  @override protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);      if (servicesok()) {         setcontentview(r.layout.activity_map);          if (initmap()) {             toast.maketext(this, "ready map!", toast.length_short).show();             gotolocation(seattle_lat, seattle_lng, defaultzoom);         }         else {             toast.maketext(this, "map not available!", toast.length_short).show();         }     }     else {         setcontentview(r.layout.activity_main);     }  } 

while running app on device on developer mode showing unfortunately app has stopped. kindly tell me suggestions or solutions. in advance.


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -