[Android]IllegalStateException: Could not find method onBind(View)
来源:互联网 发布:数据库系统工程师 pdf 编辑:程序博客网 时间:2024/05/01 10:27
FATAL EXCEPTION: main
Process: org.diql.aidldemo, PID: 2274
java.lang.IllegalStateException: Could not find method onBind(View) in a parent or ancestor Context for android:onClick attribute defined on view class android.support.v7.widget.AppCompatButton with id ‘btn_bind’
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.resolveMethod(AppCompatViewInflater.java:325)
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:284)
at android.view.View.performClick(View.java:5198)
at android.view.View$PerformClick.run(View.java:21147)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
——— beginning of system
原因:
在layout的根布局中使用了tools:context
属性,将 ayout 与一个 Activity 进行了绑定,但是在该 Activity 中进行 inflate 该 layout 时,没有发现该方法.具体可能是:
1. 该方法未声明;
2. 该方法没有用public
修饰;
- [Android]IllegalStateException: Could not find method onBind(View)
- android 报错 java.lang.IllegalStateException: Could not find a method next(View)
- java.lang.IllegalStateException: Could not find a method capture(View) in the activity class
- java.lang.IllegalStateException: Could not find a method false(View) in the activity class com.xuan
- java.lang.IllegalStateException: Could not find method onClickcrea(View) in a parent or ancestor Con
- 报错:Could not find method android.view.ViewTreeObserver.removeOnGlobalLayoutListener
- java.lang.IllegalStateException: Could not find a method onStartSingleInstanceActivityClickLisenter(
- java.lang.IllegalStateException: Could not find a method add(View) in the activity class haha.com.e
- Could not find method android() for arguments
- Android Studio Could not find method runProguard()...
- Could not find class 'android.support.v4.view.ViewPager', referenced from method***
- Could not find class 'android.support.v4.view.ViewPager', referenced from method***
- Could not find method问题解决
- Android Studio Exception: Could not find method android() for arguments
- Android Studio Exception: Could not find method android() for arguments
- Android Studio:Could not find method android() for arguments
- Could not find method update(View) in a parent or ancestor Context for android:onClick attribute def
- Could not find method android.app.Activity.on.AttachedToWindow...
- 今日学习记录
- Android开发--MVP demo+Jsoup在线小说阅读器(一)
- filter实现----网站点击计数器
- 程序员一定要学好的几门技术
- android自定义ViewGroup(侧滑菜单)
- [Android]IllegalStateException: Could not find method onBind(View)
- scanf用法及其中的陷阱
- Android线程HandlerThread源码分析
- DS
- Jquery之Select篇章
- java中数组与List相互转换的方法
- SSM架构学习心得
- 真正的强者,不是流泪的人,而是含泪奔跑的人
- JavaScript动态检测密码强度的原理及实现