I've started building a Widget for an app that is mostly map centric, i.e. consists of a screen-filling subclassed MapView, Overlay and so forth. The relevant information that is displayed by the map overlay actually fits into a Widget that uses one of the standard sizes, so it would make sense to use the subclassed MapView and all it entails inside the Widget (in the spirit of polymorphism). Looking at Google's sample code, it seems the Views that can be displayed in Widgets are limited to just a few Views (I've seen TextView and ImageView)? I suppose I could live with that (although it entails duplication), but the real thing would be using the subclassed MapView. I tried that out, but when loading the Widget, I get a class not found exception. Is there a way to use a subclassed View in a Widget?
Below the sanitized layout and the LogCat dump: <-------------------layout -----------------------> <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/ android" android:id="@+id/widget" android:layout_width="fill_parent" android:layout_height="wrap_content" android:focusable="true" style="@style/WidgetBackground"> <com.google.android.maps.MyMapView android:id="@+id/mapview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:enabled="true" android:clickable="true" android:apiKey="myKey.oi878f8w88OOiu0fu0." /> <------------------crash --------------------------------------------------> 05-17 00:09:58.162: WARN/AppWidgetHostView(611): android.view.InflateException: Binary XML file line #18: Error inflating class com.google.android.maps.MyMapView 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:575) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at android.view.LayoutInflater.rInflate(LayoutInflater.java:617) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at android.view.LayoutInflater.inflate(LayoutInflater.java:407) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at android.widget.RemoteViews.apply(RemoteViews.java:830) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at android.appwidget.AppWidgetHostView.updateAppWidget (AppWidgetHostView.java:167) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at android.appwidget.AppWidgetHost.createView(AppWidgetHost.java:218) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at com.android.launcher.Launcher.completeAddAppWidget(Launcher.java:653) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at com.android.launcher.Launcher.onActivityResult(Launcher.java:335) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at com.android.launcher.Launcher.addAppWidget(Launcher.java:957) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at com.android.launcher.Launcher.onActivityResult(Launcher.java:332) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at android.app.Activity.dispatchActivityResult(Activity.java:3595) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at android.app.ActivityThread.deliverResults(ActivityThread.java:3001) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3047) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at android.app.ActivityThread.access$2300(ActivityThread.java:112) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1721) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at android.os.Handler.dispatchMessage(Handler.java:99) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at android.os.Looper.loop(Looper.java:123) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at android.app.ActivityThread.main(ActivityThread.java:3948) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at java.lang.reflect.Method.invokeNative(Native Method) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at java.lang.reflect.Method.invoke(Method.java:521) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:782) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at dalvik.system.NativeStart.main(Native Method) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): Caused by: java.lang.ClassNotFoundException: com.google.android.maps.MyMapView in loader dalvik.system.pathclassloa...@400190f8 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at java.lang.ClassLoader.loadClass(ClassLoader.java:573) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at java.lang.ClassLoader.loadClass(ClassLoader.java:532) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at android.view.LayoutInflater.createView(LayoutInflater.java:465) 05-17 00:09:58.162: WARN/AppWidgetHostView(611): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:564) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

