当前位置:网站首页>Preventing/catching “IllegalArgumentException: parameter must be a descendant of this view” error
Preventing/catching “IllegalArgumentException: parameter must be a descendant of this view” error
2022-07-03 16:30:00 【French red wine sweet】
problem :
I have a ListView with some focusable components inside (mostly EditText s). I have one ListView There are some components that can be focused ( Mainly EditText s).Yeah, I know this isn't exactly recommended, but in general, almost everything is working fine and the focus goes where it has to go (with a few tweaks I had to code). Yes , I know this is not completely recommended , But on the whole , Almost everything is normal , And focus on where it has to go ( I have to code some adjustments ).Anyway, my problem is that there's a weird race condition when scrolling the list with your finger and then suddenly using the trackball when the IME keyboard is being displayed . in any case , My problem is when I scroll through the list with my finger and Showing IME Keyboard time Suddenly use the trackball when There will be strange competitive conditions .Something must go out of bounds and get recycled at which point the offsetRectBetweenParentAndChild() method must kick in and throw the IllegalArgumentException . Something has to cross the border and be recycled , here offsetRectBetweenParentAndChild() Method must be started and thrown IllegalArgumentException .
The problem is that this exception is thrown outside of any block in which I can insert a try/catch (as far as I know). The problem is that this exception is when I can insert try/catch Thrown outside any block of ( as far as I am concerned ).So there are two valid solutions to this question, either: So there are two effective solutions to this problem , or :
- Someone knows why this exception being thrown and how to stop it from happening Someone knows Why? Throw this exception and how to prevent it from happening
- Someone knows how to put a try/catch block somewhere that will at least let my application survive. Someone knows how to try/catch The block is placed where my application can at least survive .As far as I know the problem is that of focus, so it definitely shouldn't kill my application (which is what it's doing). as far as I am concerned , The problem is the focus , So it should never kill my application ( This is what it is doing ).I tried overriding the
ViewGroup's methods but those twooffset*methods are marked as final. I try to overwriteViewGroupMethods , But these twooffset*Method is marked as final.
Stack trace: stack trace :
08-17 18:23:09.825: ERROR/AndroidRuntime(1608): FATAL EXCEPTION: main08-17 18:23:09.825: ERROR/AndroidRuntime(1608): java.lang.IllegalArgumentException: parameter must be a descendant of this view08-17 18:23:09.825: ERROR/AndroidRuntime(1608): at android.view.ViewGroup.offsetRectBetweenParentAndChild(ViewGroup.java:2633)08-17 18:23:09.825: ERROR/AndroidRuntime(1608): at android.view.ViewGroup.offsetDescendantRectToMyCoords(ViewGroup.java:2570)08-17 18:23:09.825: ERROR/AndroidRuntime(1608): at android.view.ViewRoot.scrollToRectOrFocus(ViewRoot.java:1624)08-17 18:23:09.825: ERROR/AndroidRuntime(1608): at android.view.ViewRoot.draw(ViewRoot.java:1357)08-17 18:23:09.825: ERROR/AndroidRuntime(1608): at android.view.ViewRoot.performTraversals(ViewRoot.java:1258)08-17 18:23:09.825: ERROR/AndroidRuntime(1608): at android.view.ViewRoot.handleMessage(ViewRoot.java:1859)08-17 18:23:09.825: ERROR/AndroidRuntime(1608): at android.os.Handler.dispatchMessage(Handler.java:99)08-17 18:23:09.825: ERROR/AndroidRuntime(1608): at android.os.Looper.loop(Looper.java:130)08-17 18:23:09.825: ERROR/AndroidRuntime(1608): at android.app.ActivityThread.main(ActivityThread.java:3683)08-17 18:23:09.825: ERROR/AndroidRuntime(1608): at java.lang.reflect.Method.invokeNative(Native Method)08-17 18:23:09.825: ERROR/AndroidRuntime(1608): at java.lang.reflect.Method.invoke(Method.java:507)08-17 18:23:09.825: ERROR/AndroidRuntime(1608): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)08-17 18:23:09.825: ERROR/AndroidRuntime(1608): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)08-17 18:23:09.825: ERROR/AndroidRuntime(1608): at dalvik.system.NativeStart.main(Native Method)Solution :
Reference resources : https://stackoom.com/en/question/TnB5边栏推荐
- 线程池执行定时任务
- [combinatorics] non descending path problem (outline of non descending path problem | basic model of non descending path problem | non descending path problem expansion model 1 non origin starting poi
- 无心剑中译泰戈尔《漂鸟集(1~10)》
- TCP congestion control details | 3 design space
- 一台服务器最大并发 tcp 连接数多少?65535?
- [solved] access denied for user 'root' @ 'localhost' (using password: yes)
- How to use AAB to APK and APK to AAB of Google play apps on the shelves
- From the 18th line to the first line, the new story of the network security industry
- Qt插件之自定义插件构建和使用
- Nine ways to define methods in scala- Nine ways to define a method in Scala?
猜你喜欢

爱可可AI前沿推介(7.3)

消息队列消息丢失和消息重复发送的处理策略

Colab works with Google cloud disk
![[combinatorics] non descending path problem (outline of non descending path problem | basic model of non descending path problem | non descending path problem expansion model 1 non origin starting poi](/img/81/59ed6bebf5d85e9eb71bd4ca261309.jpg)
[combinatorics] non descending path problem (outline of non descending path problem | basic model of non descending path problem | non descending path problem expansion model 1 non origin starting poi

线程池执行定时任务

Record a jar package conflict resolution process

A survey of state of the art on visual slam

2022 love analysis · panoramic report of digital manufacturers of state-owned enterprises

Data driving of appium framework for mobile terminal automated testing

From the 18th line to the first line, the new story of the network security industry
随机推荐
Golang anonymous function use
Remote file contains actual operation
Visual SLAM algorithms: a survey from 2010 to 2016
Mixlab编辑团队招募队友啦~~
nifi从入门到实战(保姆级教程)——flow
PHP CI(CodeIgniter)log级别设置
为抵制 7-Zip,列出 “三宗罪” ?网友:“第3个才是重点吧?”
SVN使用规范
Learn from me about the enterprise flutter project: simplified framework demo reference
中南大学|通过探索理解: 发现具有深度强化学习的可解释特征
ThreeJS 第二篇:顶点概念、几何体结构
Yu Wenwen, Hu Xia and other stars take you to play with the party. Pipi app ignites your summer
TCP拥塞控制详解 | 3. 设计空间
拼夕夕二面:说说布隆过滤器与布谷鸟过滤器?应用场景?我懵了。。
How can technology managers quickly improve leadership?
What is the maximum number of concurrent TCP connections for a server? 65535?
高等数学(第七版)同济大学 习题2-1 个人解答
Qt插件之自定义插件构建和使用
QT serial port UI design and solution to display Chinese garbled code
Hong Kong Polytechnic University | data efficient reinforcement learning and adaptive optimal perimeter control of network traffic dynamics