0

I have successfully used RequestFactory for a very long time in my Android app, but now when trying to upgrade to maps v2, when I include

<fragment
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/map"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        class="com.google.android.gms.maps.SupportMapFragment" />

in my XML layout file, I get the error:

01-25 08:08:41.978: E/AndroidRuntime(19854):
java.lang.RuntimeException: Unable to resume activity{com.xx/com.xx.MyActivity}:
java.lang.RuntimeException: The RequestFactory ValidationTool must be
run for the com.xx.client.MyRequestFactory RequestFactory type

If I remove the fragment code from the layout XML file everything works fine.

How does this fragment affect my RequestFactory validation and how can I fix it?

Thanks.

aez
  • 2,406
  • 2
  • 26
  • 46
  • Wow, stumbled on to this http://stackoverflow.com/questions/8049351/how-to-use-the-gwt-requestfactory-in-android-syncadapter-always-getting-validat and it solved the problem, but I don't understand exactly why yet. – aez Jan 26 '13 at 04:00

1 Answers1

0

As pointed out in How to Use the GWT-RequestFactory in Android SyncAdapter (always getting ValidationTool-Error)

if one adds

Thread.currentThread().setContextClassLoader(mContext.getClassLoader());

before

requestFactory = RequestFactorySource.create(factoryClass);

the problem is fixed.

Community
  • 1
  • 1
aez
  • 2,406
  • 2
  • 26
  • 46