判断当前Activity上显示的是哪个Fragment
Kotlinval fragmentManager: Fragment? = this@MainActivity.fragmentManager.findFragmentById(R.id.flSetContent)//R.id.flSetContent就是我们Activity里面用于添加Fragment的底层布局ID if (fragmentManager != null && fragmentManager is CommonFragment) { Log.e("
原创
2021-09-27 19:25:51 ·
1245 阅读 ·
1 评论