【问题标题】:check which fragment is loaded in framelayout before replacing it在替换之前检查框架布局中加载了哪个片段
【发布时间】:2013-03-20 04:37:56
【问题描述】:

是否可以在添加之前检查片段是否已经加载到 FrameLayout 中?

【问题讨论】:

  • 我想我找到了我要找的东西here

标签: android android-fragments android-framelayout fragmenttransaction


【解决方案1】:
Fragment a = getSupportFragmentManager().findFragmentById(R.id.FrameLayout);

if(a == null)
    FrameLayout is empty

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多