开发者

Mapview and Spinner both in Activity Group

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 assumi开发者_运维技巧ng this is caused by this.getParent() not being a mapactivity? How would I fix this?


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.


I ended up adding the spinner programatically.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜