RequestFactory check fails if you enable Android maps v2 fragment

I have successfully used RequestFactory in my Android app for a very long time, but now that you are trying to upgrade to v2 cards, when I turn on

 <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 an 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 delete the fragment code from the XML layout file, everything works fine.

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

Thanks.

0
source share
1 answer

As stated in How to use GWT-RequestFactory in Android SyncAdapter (always getting ValidationTool-Error)

if you add

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

before

 requestFactory = RequestFactorySource.create(factoryClass); 

The problem is fixed.

0
source

Source: https://habr.com/ru/post/901013/


All Articles