当前位置:网站首页>mTabLayout. setOnTabSelectedListener is deprecated
mTabLayout. setOnTabSelectedListener is deprecated
2022-06-10 13:04:00 【yechaoa】
use addOnTabSelectedListener Instead of , The method is the same .
Source code :
/**
* @deprecated Use {@link #addOnTabSelectedListener(OnTabSelectedListener)} and
* {@link #removeOnTabSelectedListener(OnTabSelectedListener)}.
*/
@Deprecated
public void setOnTabSelectedListener(@Nullable OnTabSelectedListener listener) {
// The logic in this method emulates what we had before support for multiple
// registered listeners.
if (mSelectedListener != null) {
removeOnTabSelectedListener(mSelectedListener);
}
// Update the deprecated field so that we can remove the passed listener the next
// time we're called
mSelectedListener = listener;
if (listener != null) {
addOnTabSelectedListener(listener);
}
}
/**
* Add a {@link TabLayout.OnTabSelectedListener} that will be invoked when tab selection
* changes.
*
* <p>Components that add a listener should take care to remove it when finished via
* {@link #removeOnTabSelectedListener(OnTabSelectedListener)}.</p>
*
* @param listener listener to add
*/
public void addOnTabSelectedListener(@NonNull OnTabSelectedListener listener) {
if (!mSelectedListeners.contains(listener)) {
mSelectedListeners.add(listener);
}
}边栏推荐
- The Japanese version of arXiv is a cool batch: only 37 papers have been received after more than 2 months
- 性能测试方案(计划)模板
- Tidb Primary course experience 8 (Management Maintenance of Clusters, add a tikv Node)
- ASP. Net using imagemap control to design navigation bar
- 阿里云ECS服务器搭建Mysql数据库
- 六石编程学:以文字处理的位置,谈谈命名
- Alibaba cloud ECS server builds MySQL database
- VDMA调试总结
- (6) Classes and objects, object initialization and copy constructors (3)
- [raise bar C #] how to call the base of the interface
猜你喜欢

2022年6月中国数据库排行榜:TiDB卷土重来摘桂冠,达梦蛰伏五月夺探花

Which EDA design software should Altium Allegro pads choose

文档提升计划第二期|OceanBase 邀您一起进行文档共建

JS global timer case

What if the xshell evaluation period has expired? Follow the steps below to solve the problem!

【FAQ】运动健康服务REST API接口使用过程中常见问题和解决方法总结

【移动机器人】轮式里程计原理

【Spark】(task8)SparkML中的pipeline通道建立

蚂蚁金服杨军:蚂蚁数据分析平台的演进及数据分析方法的应用

Development trend of Web Development
随机推荐
Good article sharing | 48 hour agile development introduction
list. Remove (index) returns false, removal failed
excel异步导出
Use soapUI tool to generate SMS interface code
启牛能开户吗,启牛在APP上可以直接开通券商安全吗
Start with interpreting the code automatically generated by BDC, and explain the trial version of the program components of sapgui
软件项目管理 6.10.成本预算
Code free may event Microsoft low code matrix update; Multiple industry reports released
Example of full page sliding screen at mobile terminal (sliding the whole screen up and down) (sorting)
微信web开发工具使用教程,公司开发web
[mobile robot] principle of wheel odometer
DynaSLAM II: Tightly-Coupled Multi-Object Tracking and SLAM 论文阅读
JTAG-to-AXI Master调试AXI BRAM Controller
TIDB 初级课程体验 8 (集群的管理维护, 添加一个TIKV节点)
谷歌提出超强预训练模型CoCa,在ImageNet上微调Top-1准确率达91%!在多个下游任务上SOTA!
Vdo-slam source code reading notes [2] local optimization and global optimization
H5 pop up prompt layer - top, bottom, left and right center
已拿offer,进阶学习
JS array to JSON, JSON to array. Array to comma separated string, string to array
Stereo Vision-based Semantic 3D Object and Ego-motion Tracking for Autonomous Driving 论文阅读