Comments (9)
测试一下,并没有重现你所说的情况啊
from jetpackmvvm.
@hegaojian 可以这么测试,列表同时点击两个,就会崩溃的。
from jetpackmvvm.
这种情况可以针对 NavController 添加一系列的扩展方法,其实就是重写各个 NavController#navigation 方法,添加 try catch, 因为 NavController 很蠢,没办法判断有没有 destination.
from jetpackmvvm.
可以的,我先加上吧,虽然按照你说的方法测试 列表同时点击两个 还是没有出现崩溃,但是还是加上靠谱点 @ParadiseHell
from jetpackmvvm.
@hegaojian 同时点击列表 Item, 好像 RecyclerView 有个设置,就可以避免两次同时点击只有一个点击生效,如果两个点击事件都触发了,就会调用 navigation 两次,这种情况就会崩溃。
from jetpackmvvm.
@hegaojian 其实就是 navigation 路由已经跳转了。但是第二次又被调用导致from为空,崩溃
from jetpackmvvm.
当时就是因为这个崩溃问题,我才写了这个拓展函数,限制0.5秒内不能重复点击解决这个bug,按理来说不应该再触发崩溃错误了
from jetpackmvvm.
嗯,我懂你。但是写程序的时候可能注意不到这些,或者有一些特殊情况会跳过你得方法。还是加上 try 稳定
from jetpackmvvm.
嗯嗯,感谢你的建议,先加上吧,稳健一点 😆
from jetpackmvvm.
Related Issues (20)
- Caused by: java.lang.reflect.InvocationTargetException HOT 2
- 开启混淆后,反射 inflate ViewBinding 时数组越界 HOT 1
- 用协程post请求没问题,get请求不行,没请求成功吧,直接返回200,body为null HOT 4
- 图片选、拍照引入哪个好使,引入了几个老是报冲突
- targetSdkVersion 33
- Caused by: android.view.InflateException: Binary XML file line #26: Error inflating class com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx HOT 1
- DataBinding在销毁时候导致空指针 HOT 1
- 请问下,网络请求上传图片文件这些怎么写 HOT 1
- 'com.kunminx.archi:unpeek-livedata:4.4.1-beta1'库无法下载
- com.kunminx.archi:unpeek-livedata:4.4.1-beta1库无法下载
- 你好,鸡哥,我要设置"application/x-www-form-urlencoded" 但是不知道为什么不生效,是不是我设置错地方了
- java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/lifecycle/ViewModelKt
- AGP8混淆启动 反射报错
- 引用了阿里的mpass 版本升级报错 HOT 1
- json 提交数据会转义
- 无法使用 merge 作为根布局的标签,报错如下
- kotlin.UninitializedPropertyAccessException: lateinit property app has not been initialized
- 鸡哥 抽时间更新更新呗 HOT 7
- by viewModels()报红
- 鸡哥,请教几个接口问题 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jetpackmvvm.