当前位置:网站首页>ViewModelProvider.of 过时方法解决
ViewModelProvider.of 过时方法解决
2022-07-07 02:14:00 【梦想改变生活】
过时方法
open fun <T : ViewModel?> createViewModel(activity: FragmentActivity?, cls: Class<T>?): T {
return ViewModelProviders.of(activity!!).get(cls)
}
替换成
open fun <T : ViewModel?> createViewModel(activity: FragmentActivity?, cls: Class<T>?): T {
return ViewModelProvider(activity!!).get(cls!!)
}
边栏推荐
- 直击2022ECDC萤石云开发者大会:携手千百行业加速智能升级
- LM小型可编程控制器软件(基于CoDeSys)笔记二十三:伺服电机运行(步进电机)相对坐标转换为绝对坐标
- js装饰器@decorator学习笔记
- rt-thread 中对 hardfault 的处理
- 谷歌 Chrome 浏览器发布 103.0.5060.114 补丁修复 0-day 漏洞
- Niuke Xiaobai monthly race 52 E. sum logarithms in groups (two points & inclusion and exclusion)
- Wechat applet hides the progress bar component of the video tag
- JWT certification
- [shell] summary of common shell commands and test judgment statements
- Several key steps of software testing, you need to know
猜你喜欢

面试中有哪些经典的数据库问题?

Unable to debug screen program with serial port

uniapp开发小程序如何使用微信云托管或云函数进行云开发

Redis(二)—Redis通用命令

Redis (II) - redis General Command

POI导出Excel:设置字体、颜色、行高自适应、列宽自适应、锁住单元格、合并单元格...

基于FPGA的VGA协议实现

反射(二)

Experience sharing of contribution of "management world"

ICML 2022 | explore the best architecture and training method of language model
随机推荐
Navicat importing 15g data reports an error [2013 - lost connection to MySQL server during query] [1153: got a packet bigger]
循环肿瘤细胞——Abnova 解决方案来啦
ST表预处理时的数组证明
POI export to excel: set font, color, row height adaptation, column width adaptation, lock cells, merge cells
「运维有小邓」符合GDPR的合规要求
js装饰器@decorator学习笔记
Audio distortion analysis of DSP and DAC based on adau1452
力扣62 不同路径(从矩阵左上到右下的所有路径数量) (动态规划)
Navicat导入15G数据报错 【2013 - Lost connection to MySQL server during query】 【1153:Got a packet bigger】
rt-thread 中对 hardfault 的处理
How can I check the DOI number of a foreign document?
Matlab / envi principal component analysis implementation and result analysis
安装VMmare时候提示hyper-v / device defender 侧通道安全性
Party A's requirements for those who have lost 800 yuan
Ant manor safety helmet 7.8 ant manor answer
开发者别错过!飞桨黑客马拉松第三期链桨赛道报名开启
Developers don't miss it! Oar hacker marathon phase III chain oar track registration opens
Google Chrome browser released patch 103.0.5060.114 to fix the 0-day vulnerability
博士申请 | 上海交通大学自然科学研究院洪亮教授招收深度学习方向博士生
拼多多败诉:“砍价免费拿”侵犯知情权但不构成欺诈,被判赔400元