包括Android地图V2片段时RequestFactory验证失败(RequestFactory

2019-10-17 15:00发布

我已经成功地使用RequestFactory在我的Android应用程序很长一段时间,但现在想升级到地图V2的时候,当我有

<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" />

在我的XML布局文件,我得到的错误:

 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 

如果我从布局XML删除片段代码文件,一切工作正常。

这将如何影响片段我RequestFactory验证,我该如何解决?

谢谢。

Answer 1:

正如指出如何使用GWT-RequestFactory Android中SyncAdapter(总是让ValidationTool错误)

如果加上

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

之前

requestFactory = RequestFactorySource.create(factoryClass);

问题得到解决。



文章来源: RequestFactory validation fails when including Android maps v2 fragment