【问题标题】:Android unable to load class errorAndroid无法加载类错误
【发布时间】:2013-12-11 18:41:49
【问题描述】:

我正在尝试使用 github 示例 https://github.com/chrisbanes/Android-PullToRefresh 实现 pull-to-refresh,但是当我尝试实现列表视图时,它让我无法加载类 master\library\src\com\handmark\pulltorefresh\library\ pullToRefreshListView

I have imported library project into system and also placed the jar file.

我运行了使用这个库的示例项目,它的屏幕截图是:

但是当我试图在我的项目中实现这个类时,它的给定类未找到异常我已经创建了一个 libs 文件夹并将 library.jar 文件放在那里并将其添加到构建路径但仍然在运行时抛出此错误.

在我的xml文件中

<com.handmark.pulltorefresh.library.PullToRefreshListView
    android:id="@+id/listView1"
    android:divider="#E4E4E4"
    android:dividerHeight="2dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:cacheColorHint="#00000000"
    android:fadingEdge="none"
    android:fastScrollEnabled="false"
    android:footerDividersEnabled="false"
    android:headerDividersEnabled="false"
    android:smoothScrollbar="true" />

【问题讨论】:

  • 您的导入方式或使用方式有问题。你能在你使用它的地方发布一些代码,并描述你是如何将它导入到你的项目中的吗?
  • 尝试点击

标签: android listview pull-to-refresh


【解决方案1】:

终于解决了

代替在 lib 中添加 jar 文件并将其添加到构建路径,我们必须将库项目作为依赖项目

你必须在这里添加项目

RightClick:==> 属性 ==> Android ==>> 库(添加)

【讨论】:

    【解决方案2】:

    您是否正确链接库?请检查您的 IDE 或 project.properties。

    【讨论】:

    • 谢谢我得到了解决方案
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-02-19
    • 1970-01-01
    • 2017-12-13
    • 1970-01-01
    • 2016-04-29
    • 2010-11-10
    相关资源
    最近更新 更多