Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ptrClassicFrameLayout.setLoadMoreEnable(true); 这行空指针 #77

Open
maxinlei opened this issue May 8, 2017 · 5 comments
Open

ptrClassicFrameLayout.setLoadMoreEnable(true); 这行空指针 #77

maxinlei opened this issue May 8, 2017 · 5 comments

Comments

@maxinlei
Copy link

maxinlei commented May 8, 2017

已经增加RecyclerAdapterWithHF 但是setLoadMoreEnable(true);还是空指针

@maxinlei
Copy link
Author

maxinlei commented May 8, 2017

demo 就没有问题 我用的是 compile 'com.chanven.lib:cptr:1.1.0

@yangjinghit
Copy link

找了3个小时,终于解决了

private void init() {
if (mSwipeRefreshLayout.getChildCount() <= 0) {
throw new RuntimeException("SwipRefreshLayout has no child view");
}
try {
Field field = mSwipeRefreshLayout.getClass().getDeclaredField("mTarget");
field.setAccessible(true);
mContentView = (View) field.get(mSwipeRefreshLayout);
} catch (Exception e) {
e.printStackTrace();
}
}

2 similar comments
@yangjinghit
Copy link

找了3个小时,终于解决了

private void init() {
if (mSwipeRefreshLayout.getChildCount() <= 0) {
throw new RuntimeException("SwipRefreshLayout has no child view");
}
try {
Field field = mSwipeRefreshLayout.getClass().getDeclaredField("mTarget");
field.setAccessible(true);
mContentView = (View) field.get(mSwipeRefreshLayout);
} catch (Exception e) {
e.printStackTrace();
}
}

@yangjinghit
Copy link

找了3个小时,终于解决了

private void init() {
if (mSwipeRefreshLayout.getChildCount() <= 0) {
throw new RuntimeException("SwipRefreshLayout has no child view");
}
try {
Field field = mSwipeRefreshLayout.getClass().getDeclaredField("mTarget");
field.setAccessible(true);
mContentView = (View) field.get(mSwipeRefreshLayout);
} catch (Exception e) {
e.printStackTrace();
}
}

@CUIYONGCHUANG
Copy link

private void init() {
if (mSwipeRefreshLayout.getChildCount() <= 0) {
throw new RuntimeException("SwipRefreshLayout has no child view");
}
try {
Field field = mSwipeRefreshLayout.getClass().getDeclaredField("mTarget");
field.setAccessible(true);
mContentView = (View) field.get(mSwipeRefreshLayout);
} catch (Exception e) {
e.printStackTrace();
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants