Fragment getArguments () zwraca wartość null

mamFragment który maTabHost jako układ główny w następujący sposób ...

<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" />

        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">

            <FrameLayout
                android:id="@+id/tab_1"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent" />

            <!-- More FrameLayouts here - each are placeholders for Fragments -->    

        </FrameLayout>
    </LinearLayout>
</TabHost>

Kod do tworzenia / aktualizacji każdegoFragment zawartość karty jest następująca ...

private void updateTab(String tabId, int placeholder) {
    FragmentManager fm = getFragmentManager();
    if (fm.findFragmentByTag(tabId) == null) {
        Bundle arguments = new Bundle();
        arguments.putInt("current_day", mCurrentTab);
        EpgEventListFragment fragment = new EpgEventListFragment();
        fragment.setArguments(arguments);

        fm.beginTransaction()
                .replace(placeholder, new EpgEventListFragment(), tabId)
                .commit();
    }
}

wonCreate(...) metodaEpgEventListFragment Następnie próbuję uzyskać argumentyBundle ale zawsze dostajęnull robiąc co następuje ...

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Bundle arguments = getArguments();
    if (arguments == null)
        Toast.makeText(getActivity(), "Arguments is NULL", Toast.LENGTH_LONG).show();
    else
        mCurrentDay = getArguments().getInt("current_day", 0);

    ...
}

Czego mi tu brakuje? Próbowałem teżgetArguments() wonAttach(...) ale wciąż mam zero. Jestem nowy w użyciuFragments więc mam nadzieję, że jest prosty powód, ale nic nie wymyśliłem podczas wyszukiwania.

questionAnswers(1)

yourAnswerToTheQuestion