【发布时间】:2017-02-18 03:16:55
【问题描述】:
我正在使用 android.app.Fragment,有人请帮我理解为什么当我尝试将此片段添加到事务中时,我在 FG 下得到一个红线错误?我没有正确输入吗?我在下面添加了一个截图:
【问题讨论】:
标签: android android-activity transactions fragment
我正在使用 android.app.Fragment,有人请帮我理解为什么当我尝试将此片段添加到事务中时,我在 FG 下得到一个红线错误?我没有正确输入吗?我在下面添加了一个截图:
【问题讨论】:
标签: android android-activity transactions fragment
使用android.support.v4.app.Fragment并添加片段如下
getSupportFragmentManager()
.beginTransaction()
.add(R.id.fragment_container, new Fragment_One())
.addToBackStack(null)
.commit();
您的活动必须扩展AppCompatActivity
【讨论】: