android - 如何从通知片段中打开正确的指定名称选项卡?
问题描述
我是初学者开发者 android,我希望我的通知片段导致正确的名称选项卡位置我的参数在 rest val tab_approval_type:String 我的参数选项卡批准包含 3 个参数:加班、休假、许可,我的选项卡包含一个片段中包含的 3 种类型,我的名字选项卡:加班,请假,允许我想要这个结果示例我从通知片段单击允许,然后参数显示选项卡允许。
my code like this in fragment notification
private fun navigate(type: String) {
if (findNavController().currentDestination?.id == R.id.notificationFragment) {
when (type) {
"Approval" -> findNavController().navigate(NotificationFragmentDirections.navigateToApproval())
}
}
}
how to fix this? thank you
解决方案
推荐阅读
- android - 从 Play 控制台中删除应用
- java - 处理来自 Bean 类的线程“main”java.lang.NullPointerException 中的异常的最佳实践
- c++ - 读取文本文件,C++
- node.js - Multer 不会以任何方式将图像保存在磁盘上
- python - Path handling error calling Windows Python from within WSL
- java - Shim 客户端 java 链码 Hyperledger Fabric 1.1
- python - DLL Load failed error when installing opencv for Python 3.6.3 on Windows 10
- json - vscode 中的 launch.json 中不允许使用属性 args
- sql - 如何在SQL中选择一个字段中最新记录且不重复的记录?
- ruby - 增加firebase存储jpeg链接红宝石的到期时间