0

I'm trying to make a mapactivity with both a mapview and a spinner. This mapactivity is inside of an activity group. When doing this

setContentView(R.layout.mpcategorychooser);

The view renders but crashes when the spinner is selected. I've looked at how to fix badtokenexceptions for spinners inside an activity group in previous questions such as this one: Error while placing a spinner inside Activity Group

But when I try using

View viewToLoad = LayoutInflater.from(this.getParent()).inflate(R.layout.main, null);
this.setContentView(viewToLoad);  

I get a problem with the mapview I had in R.layout.main

07-06 16:40:38.827: ERROR/ACRA(2743): Caused by: android.view.InflateException: Binary         XML file line #14: Error inflating class com.google.android.maps.MapView

I am assuming this is caused by this.getParent() not being a mapactivity? How would I fix this?

Community
  • 1
  • 1
Kevin Qiu
  • 1,616
  • 1
  • 13
  • 15

2 Answers2

1

Make an XML which has a list and a google map on the list you can create an item that calls an XML to have the combobox, so there will be no conflict between the event's own touch and google map the event of layoutinflater touch.

Michael Petrotta
  • 59,888
  • 27
  • 145
  • 179
0

I ended up adding the spinner programatically.

Kevin Qiu
  • 1,616
  • 1
  • 13
  • 15