-
Notifications
You must be signed in to change notification settings - Fork 588
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
是不是不支持Fragment,我放在Fragment中有问题,如何破 #65
Comments
info_known.xml 文件中 android:onClick不能用在Fragment的xml中。。。 |
mHightLight.getHightLightView().findViewById(R.id.iv_known).setOnClickListener(new View.OnClickListener() { 这样写可以,你运行试试吧还会出其他问题,开始是空指针,你会解决的;弄好以后fragment来回切换还会出问题这个我也解决不了了 |
只能是在ativity里使用了。 |
注入的点击事件clickKnown写到activity可行。 |
Process: com.zhy.highlight, PID: 14551
java.lang.IllegalStateException: Could not find method clickKnown(View) in a parent or ancestor Context for android:onClick attribute defined on view class android.widget.ImageView with id 'iv_known'
at android.view.View$DeclaredOnClickListener.resolveMethod(View.java:4758)
at android.view.View$DeclaredOnClickListener.onClick(View.java:4717)
at android.view.View.performClick(View.java:5638)
at android.view.View$PerformClick.run(View.java:22435)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6189)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:887)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:777)
The text was updated successfully, but these errors were encountered: