当前位置:网站首页>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边栏推荐
- Basis of target detection (IOU)
- Top k questions of interview
- LeetCode1491. Average value of wages after removing the minimum wage and the maximum wage
- How to use AAB to APK and APK to AAB of Google play apps on the shelves
- Pointcut expression
- Netease UI automation test exploration: airtest+poco
- 斑馬識別成狗,AI犯錯的原因被斯坦福找到了
- [web security] - [SQL injection] - error detection injection
- 线程池执行定时任务
- NSQ源码安装运行过程
猜你喜欢

NSQ source code installation and operation process

Two sides of the evening: tell me about the bloom filter and cuckoo filter? Application scenario? I'm confused..
![[solved] access denied for user 'root' @ 'localhost' (using password: yes)](/img/71/1ff8ed1d773da99054310f96dca3f8.jpg)
[solved] access denied for user 'root' @ 'localhost' (using password: yes)

Record a jar package conflict resolution process

Visual SLAM algorithms: a survey from 2010 to 2016
![[proteus simulation] 74hc595+74ls154 drive display 16x16 dot matrix](/img/d6/3c21c25f1c750f17aeb871124e80f4.png)
[proteus simulation] 74hc595+74ls154 drive display 16x16 dot matrix

于文文、胡夏等明星带你玩转派对 皮皮APP点燃你的夏日

Mysql 单表字段重复数据取最新一条sql语句

TCP congestion control details | 3 design space

Record windows10 installation tensorflow-gpu2.4.0
随机推荐
[proteus simulation] 74hc595+74ls154 drive display 16x16 dot matrix
Data driving of appium framework for mobile terminal automated testing
8 cool visual charts to quickly write the visual analysis report that the boss likes to see
斑馬識別成狗,AI犯錯的原因被斯坦福找到了
Golang decorator mode and its use in NSQ
QT serial port UI design and solution to display Chinese garbled code
一台服务器最大并发 tcp 连接数多少?65535?
How to use AAB to APK and APK to AAB of Google play apps on the shelves
Asemi rectifier bridge umb10f parameters, umb10f specifications, umb10f package
Getting started with Message Oriented Middleware
(Supplement) double pointer topic
中南大学|通过探索理解: 发现具有深度强化学习的可解释特征
特征多项式与常系数齐次线性递推
2022 love analysis · panoramic report of digital manufacturers of state-owned enterprises
Explore Cassandra's decentralized distributed architecture
MongoDB 的安装和基本操作
记一次jar包冲突解决过程
Stm32f103c8t6 firmware library lighting
疫情常态化大背景下,关于远程办公的思考|社区征文
Client does not support authentication protocol requested by server; consider upgrading MySQL client