我在使这个库工作时遇到了一些麻烦。有问题的库是PullToRefresh,根据Android Studio,库中存在一些文件错误导致它无法正常工作。该项目可以正常编译,但一旦它试图在我的设备上运行它就会显示“已停止工作”,LogCat会发出一些有关LayoutInflater不正确的信息。其他人有这个工作正常,所以我怀疑这是有错误的图书馆,虽然有人可以帮我解决这个问题,我将不胜感激。我有actionbarsherlock被用作库,它工作得很好,我尝试删除actionbarsherlock只是为了看看是否是问题,错误仍然发生。
这就是android studio所说的无法使用库的原因。如果需要,请求logcat。
Rendering Problems The following classes could not be instantiated:
- com.handmark.pulltorefresh.library.PullToRefreshScrollView (Open Class, Show Exception)
Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE
Exception Details java.lang.NullPointerException
at com.handmark.pulltorefresh.library.internal.LoadingLayout.<init>(LoadingLayout.java:83)
at com.handmark.pulltorefresh.library.internal.RotateLoadingLayout.<init>(RotateLoadingLayout.java:42)
at com.handmark.pulltorefresh.library.PullToRefreshBase$AnimationStyle.createLoadingLayout(PullToRefreshBase.java:1328)
at com.handmark.pulltorefresh.library.PullToRefreshBase.createLoadingLayout(PullToRefreshBase.java:587)
at com.handmark.pulltorefresh.library.PullToRefreshBase.init(PullToRefreshBase.java:1108)
at com.handmark.pulltorefresh.library.PullToRefreshBase.<init>(PullToRefreshBase.java:113)
at com.handmark.pulltorefresh.library.PullToRefreshScrollView.<init>(PullToRefreshScrollView.java:33)
at java.lang.reflect.Constructor.newInstance
at android.view.LayoutInflater.rInflate_Original
at android.view.LayoutInflater_Delegate.rInflate
at android.view.LayoutInflater.rInflate
at android.view.LayoutInflater.inflate
at android.view.LayoutInflater.inflate