Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

@AfterViews method is called multiple times if the same @EFragment instance is added again #1264

Copy link
Copy link
@litao0621

Description

@litao0621
Issue body actions

the first to enter called once ,the second to enter called twice,and so on

This is my code

public void beginTransaction(Fragment fragment, String tag, Bundle bundle) {
        try {

            manager = getFragmentManager();
            if (bundle != null) {
                fragment.setArguments(bundle);
            }
            transaction = manager.beginTransaction();
            transaction.replace(R.id.main, fragment, tag);

            transaction.commit();

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    @CheckedChange({ R.id.main_tab_project, R.id.main_tab_moment,R.id.main_tab_infomation,R.id.main_tab_personal_info })
    void checkedChangedOnSomeCheckBoxs(CompoundButton btn, boolean isChecked) {
        if (isChecked) {
        switch (btn.getId()) {
        case R.id.main_tab_project:
            beginTransaction(mFragmentProjectList,"mFragmentProjectList",null);
            break;
        case R.id.main_tab_moment:
            beginTransaction(mFragmentMoment,"mFragmentMoment",null);
            break;
        case R.id.main_tab_infomation:
            beginTransaction(mFragmentInformation,"mFragmentInformation",null);
            break;
        case R.id.main_tab_personal_info:
            beginTransaction(mFragmentPersonal,"mFragmentPersonal",null);
            break;
        }
        }
    }
<RadioGroup
            android:id="@+id/main_radio"
            android:layout_width="match_parent"
            android:layout_height="@dimen/comm_line_height"
            android:layout_alignParentBottom="true"
            android:padding="@dimen/comm_space_3"
            android:gravity="bottom"
            android:background="@color/header_background_color"
            android:orientation="horizontal" >

            <RadioButton
                android:id="@+id/main_tab_project"
                style="@style/MainTabTheme"
                android:drawableTop="@drawable/selector_main_tab_project"
                android:text="@string/main_tab_project" />
            <RadioButton
                android:id="@+id/main_tab_moment"
                style="@style/MainTabTheme"
                android:drawableTop="@drawable/selector_main_tab_project"
                android:text="@string/main_tab_moment" />

            <RadioButton
                android:id="@+id/main_tab_infomation"
                style="@style/MainTabTheme"
                android:drawableTop="@drawable/selector_main_tab_information"
                android:text="@string/main_tab_information" />

            <RadioButton
                android:id="@+id/main_tab_personal_info"
                style="@style/MainTabTheme"
                android:drawableTop="@drawable/selector_main_tab_personal_info"
                android:text="@string/main_tab_personal_info" />
        </RadioGroup>
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.