添加片段时出错

时间:2017-02-18 03:16:55

标签: android android-activity transactions fragment

我正在使用android.app.Fragment,有人请帮助我理解为什么当我尝试将此片段添加到事务中时,我在FG下出现红线错误?我没有正确输入吗?我在下面添加了一个截图:

Screenshot

1 个答案:

答案 0 :(得分:0)

使用Private Sub CommandButton1_Click() Dim wb As Workbook Dim sh As Worksheet Set wb = ActiveWorkbook ' best is to use Set wb = Workbooks("workbookname.xlsx") Set sh = wb.Sheets("Sheet1") ' you may use Set sh = wb.Sheets("Sheet1") If Trim(Me.TextBox_Search_Data.Value) <> "," Then sh.Range(Trim(Me.TextBox_Search_Data.Value)).Activate End If Set sh = Nothing Set wb = Nothing End Sub 并添加片段如下

android.support.v4.app.Fragment

您的活动必须延长getSupportFragmentManager() .beginTransaction() .add(R.id.fragment_container, new Fragment_One()) .addToBackStack(null) .commit();