Hai, I am using MapView in my application.I ma getting "android.view.inflateException:Binary XML file line #43:Inflating Class<unknown>" Exception while loading the map second time. First Time it shows correctly
The XML file i am using shows here <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:background="@color/black" android:layout_gravity="center_horizontal" android:scrollbars="vertical"> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:background="@color/black" android:layout_gravity="center"> <TextView android:padding="20px" android:text="" android:id="@+id/ eventname" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:textColor="@color/bg_color" android:textStyle="bold" android:textSize="12px"></TextView> </LinearLayout> <ScrollView android:layout_marginBottom="40dip" android:id="@+id/ ScrollView01" android:layout_height="wrap_content" android:layout_width="fill_parent"> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:background="@color/black"> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:paddingLeft="20px" android:layout_height="wrap_content" android:orientation="horizontal" android:background="@color/black" android:layout_gravity="center_horizontal"> <ImageView android:id="@+id/ImageView01" android:scaleType="fitCenter" android:layout_width="100dip" android:layout_height="120dip" ></ImageView> <ImageView android:id="@+id/ImageView02" android:scaleType="fitCenter" android:layout_width="100dip" android:layout_height="120dip" ></ImageView> </LinearLayout> <TextView android:paddingLeft="20px" android:text="" android:id="@ +id/maindet" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/bg_color" android:textSize="12px"></ TextView> <TextView android:textStyle="bold" android:paddingLeft="20px" android:text="Muzieikstijlen" android:id="@+id/stylet" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/bg_color" android:textSize="12px"></ TextView> <TextView android:paddingLeft="20px" android:text="" android:id="@ +id/styletype" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/subtitles" android:textSize="12px"></ TextView> <TextView android:textStyle="bold" android:paddingLeft="20px" android:text="Prinjzen" android:id="@+id/prijzen" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/bg_color" android:textSize="12px"></ TextView> <TextView android:paddingLeft="20px" android:text="" android:id="@ +id/voor" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/subtitles" android:textSize="12px"></ TextView> <TextView android:textStyle="bold" android:paddingLeft="20px" android:text="Line-up" android:id="@+id/lineup" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/bg_color" android:textSize="12px"></ TextView> <TextView android:paddingLeft="20px" android:text="" android:id="@ +id/djlist" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/subtitles" android:textSize="12px"></ TextView> <TextView android:textStyle="bold" android:paddingLeft="20px" android:text="Minimumleeftijd" android:id="@+id/min" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/bg_color" android:textSize="12px"></ TextView> <TextView android:paddingLeft="20px" android:text="" android:id="@ +id/minage" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:textColor="@color/subtitles" android:textSize="12px"></ TextView> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:paddingLeft="20px" android:layout_height="wrap_content" android:orientation="horizontal" android:background="@color/black" android:layout_gravity="center_horizontal"> <com.google.android.maps.MapView android:id="@+id/mapview" android:layout_width="fill_parent" android:layout_height="150px" android:enabled="true" android:apiKey="09gEnOY0Az6AS60vkPKRfgaZ8YJjngQkFw4s7WA" /> </LinearLayout> </LinearLayout> </ScrollView> <RelativeLayout android:layout_marginTop="-40dip" android:gravity="bottom" android:layout_height="wrap_content" android:layout_width="wrap_content"> <Button android:id="@+id/backe" android:layout_height="40px" android:layout_width="110px" android:layout_gravity="center" android:background="@color/black" android:text="Back" android:textSize="20px" android:textColor="@color/bg_color"></Button> </RelativeLayout> </LinearLayout> The Code public void setDet() { try{ imgfront = DownloadImage(d[event_id]); setContentView(R.layout.eventdet); eventname = (TextView) findViewById(R.id.eventname); eventname.setText(nm[event_id]); maindet = (TextView) findViewById(R.id.maindet); maindet.setText("\n" + eventday[event_id] + "\n" + strt[event_id] + ":" + endt[event_id] + "\n" + lnm[event_id] + "\n" + pla[event_id] + "\n"); voor = (TextView) findViewById(R.id.voor); voor.setText("Voorverkoop: " + vkoop[event_id] + "\n"); mage = (TextView) findViewById(R.id.minage); mage.setText(min_age[event_id] + "\n"); styletype = (TextView) findViewById(R.id.styletype); styletype.setText(styles[event_id] + "\n"); djl = (TextView) findViewById(R.id.djlist); djl.setText(djlist[event_id] + "\n"); mapView=(MapView)findViewById(R.id.mapview); //mapView.setBuiltInZoomControls(true); List<Overlay> mapOverlays = mapView.getOverlays(); Drawable drawable = this.getResources().getDrawable(R.drawable.pinpoint); HelloItemizedOverlay itemizedoverlay = new HelloItemizedOverlay(drawable,this); GeoPoint point = new GeoPoint((int)(latitude[event_id]*(1E6)),(int) (logintude[event_id]*(1E6))); //OverlayItem overlayitem = new OverlayItem(point, "Laissez les bon temps rouler!", "I'm in Louisiana!"); //LinearLayout zoomLayout=(LinearLayout)findViewById(R.id.zoom); //View zoomView=mapView.getZoomControls(); //zoomLayout.addView(zoomView,new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT)); mapView.displayZoomControls(true); //itemizedoverlay.addOverlay(overlayitem); // itemizedoverlay.addOverlay(overlayitem2); mc=mapView.getController(); mc.animateTo(point); mc.setZoom(13); mapOverlays.add(itemizedoverlay); mapView.invalidate(); imf = (ImageView) findViewById(R.id.ImageView01); imf.setImageBitmap(imgfront); imf.setOnClickListener(this); if (!img_b[event_id].equals("No Back Image")) { imgback = DownloadImage(img_b[event_id]); imb = (ImageView) findViewById(R.id.ImageView02); imb.setImageBitmap(imgback); imb.setOnClickListener(this); } backE=(Button)findViewById(R.id.backe); backE.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { if(eve==2) tips(); else if(eve==1) searchDet(); } }); }catch(Exception e){ Toast.makeText(this, ""+e, 100).show(); tips(); } } -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

