- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试使用 https://github.com/chrisbanes/Android-PullToRefresh/ .我跟着这个例子,但得到了错误java.lang.NoSuchFieldError:com.handmark.pulltorefresh.library.R$id.pull_to_refresh_sub_text
这是我的网格:
<com.handmark.pulltorefresh.library.PullToRefreshGridView
xmlns:ptr="http://schemas.android.com/apk/res/com.abc.myproject"
android:id="@+id/gv_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:listSelector="#00000000"
android:padding="4dp"
android:horizontalSpacing="4dp"
android:verticalSpacing="4dp"
android:gravity="center"
android:numColumns="3"
android:columnWidth="128px"
android:stretchMode="columnWidth"
ptr:ptrMode="pullDownFromTop"
ptr:ptrDrawable="@drawable/android" />
当我运行时出现上述异常。我将 PullToRefresh 添加为工作区中的另一个项目,并将其作为我项目的库。我还添加了 Jar 文件。我认为错误是因为这条线 xmlns:ptr="http://schemas.android.com/apk/res/com.abc.myproject"?
我跟踪了代码,导致异常的行在 LoadingLayout.java 中:mSubHeaderText = (TextView) header.findViewById(R.id.pull_to_refresh_sub_text);
我做错了什么吗?
谢谢!
最佳答案
Android SDK 工具 r17 添加了对库中具有自定义属性的自定义 View 的支持。使用自定义属性的布局必须使用命名空间 URI:
http://schemas.android.com/apk/res-auto
而不是包含应用程序包名称的 URI。此 URI 在构建时替换为应用特定的 URI。
关于android - Chris Banes 的 Android-PullToRefresh java.lang.NoSuchFieldError : com. handmark.pulltorefresh.library.R$id.pull_to_refresh_sub_text,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10937496/
我正在尝试更新我正在从2.4.3版开发到2.5.2版的Android应用程序上的Room数据库,这些是我的gradle.build文件中的Room依赖项。该应用程序成功编译和构建,但不幸的是,在运行时
我刚刚升级了一个库,另一个库开始抛出 NoSuchFieldError。如果删除该字段,那会很好。但它留下来了。它只是被弃用了。 Hibernate.TIMESTAMP.nullSafeGet(nul
输出:javap -s SomeClass public org.someapp.SomeClass$_data data; Signature: Lorg/someapp/SomeClass$_
我正在尝试修改我在 ClassA 中创建的 public static final String[] 字段,然后在 ClassB 中使用反射对其进行修改。但是我得到了一个 NoSuchFieldExc
我目前正在摆弄 javassist 并遇到了这个问题。我正在尝试使用 javassist 更改字段类型。但是,当代码在我更改后尝试访问该字段时,结果是 NoSuchFieldException。 所以
我的代码中出现 NoSuchFieldError,现在 oracle 不太清楚为什么会抛出此错误,只是说:如果类的定义发生不兼容的更改,此错误只会在运行时发生。 有人可以向我解释如何“不兼容地改变”一
我有一个 Spring Boot 2 项目。 该模型是 @Entity @SequenceGenerator(name = "climate_gen", sequenceName = "climate
我最近遇到了 Eclipse SWT GUI 应用程序的问题。我试图使用以下代码获取窗口句柄: Display.getDefault().syncExec(()->{ hand
我在初始化 web 应用程序时收到以下错误。有人见过这个吗? 这发生在 spring 尝试加载 SimpleUrlHandlerMapping 的地方 Caused by: java.lang.NoS
启动 NeoServer 时出现以下异常 - Exception in thread "main" java.lang.NoSuchFieldError: cypher_parser_version
网上有一个关于如何在 Hibernate 中使用注释的示例(在此之前我也研究过相同的示例,但它使用了 .xml。并且我已经成功地使其正常工作)。所以现在我有: Initial session fact
这个问题在这里已经有了答案: JNI: NoSuchFieldError (1 个回答) 关闭 9 年前。 我正在创建一个使用 JNI 的 Java 应用程序。 JNI 函数之一接受枚举作为参数。但
与 GEM API 集成时,我在 runtime java.lang.NoSuchFieldError: gostR28147_cbc 处收到错误。请让我知道我缺少什么。我已经包含了以下 jar :
请任何人告诉我如何解决此错误, 我正在使用 spring-webmvc.3.2.17 和 freemarker.2.3.16 Caused by: org.springframework.beans.
我目前正在使用 vscode 和 apache poi,创建了一个程序来自动创建 .xlsx 程序,并让 A1 单元格输入一个名为“Tester”的字符串,然后弹出该错误。 我的程序中的代码: pac
我在使用 Firebase 产品时遇到 java.lang.NoSuchFieldError 错误。 应用程序随机崩溃,每次启动一次,我没有看到任何明显的原因。 Crashlytics 将其识别为两个
我已重新启动服务器,但无法让它运行。我在启动时总是出现此错误。请问有人可以告诉我如何让服务器运行吗? 我已经搜索过,但在其他地方找不到此错误。 HTTP ERROR: 500 STANDARD_IMP
在某些情况下,当从匿名类访问 Activity 字段时,我在运行时收到 NoSuchFieldError:java.lang.NoSuchFieldError: MyActivity.myField
我开发了一个 Spring Boot 应用程序,我试图包含一个 Optional ( java.lang ) 字段在我的一个模型中,所以如果 @RestController我正在使用 with 不会得
我今天遇到了一个异常,并设法消除了错误。首先,让我给你一个示例代码。 public class Foo () { protected String var; } public class Ba
我是一名优秀的程序员,十分优秀!