Search in sources :

Example 6 with FragmentManager

use of androidx.fragment.app.FragmentManager in project kcanotify by antest1.

the class SettingActivity method onNestedPreferenceSelected.

@Override
public void onNestedPreferenceSelected(int key) {
    Log.e("KCA", "onNestedPreferenceSelected");
    FragmentManager fm = getSupportFragmentManager();
    fm.beginTransaction().replace(R.id.fragment_container, NestedPreferenceFragment.newInstance(key), NESTED_TAG).addToBackStack(NESTED_TAG).commit();
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager)

Example 7 with FragmentManager

use of androidx.fragment.app.FragmentManager in project kcanotify by antest1.

the class SettingActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_setting);
    toolbar = findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setTitle(getString(R.string.action_settings));
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    if (savedInstanceState == null) {
        FragmentManager fm = getSupportFragmentManager();
        fm.beginTransaction().replace(R.id.fragment_container, new MainPreferenceFragment()).commit();
    }
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager)

Example 8 with FragmentManager

use of androidx.fragment.app.FragmentManager in project MVPArms by JessYanCoding.

the class BaseLazyLoadFragment method dispatchParentVisibleState.

/**
 * ViewPager场景下,当前fragment可见时,如果其子fragment也可见,则让子fragment请求数据
 */
private void dispatchParentVisibleState() {
    FragmentManager fragmentManager = getChildFragmentManager();
    List<Fragment> fragments = fragmentManager.getFragments();
    if (fragments.isEmpty()) {
        return;
    }
    for (Fragment child : fragments) {
        if (child instanceof BaseLazyLoadFragment && ((BaseLazyLoadFragment) child).isVisibleToUser) {
            ((BaseLazyLoadFragment) child).tryLoadData();
        }
    }
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager) Fragment(androidx.fragment.app.Fragment)

Example 9 with FragmentManager

use of androidx.fragment.app.FragmentManager in project Android-Image-Cropper by ArthurHub.

the class MainActivity method setMainFragmentByPreset.

private void setMainFragmentByPreset(CropDemoPreset demoPreset) {
    FragmentManager fragmentManager = getSupportFragmentManager();
    fragmentManager.beginTransaction().replace(R.id.container, MainFragment.newInstance(demoPreset)).commit();
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager)

Example 10 with FragmentManager

use of androidx.fragment.app.FragmentManager in project Gadgetbridge by Freeyourgadget.

the class ActivityListingChartFragment method showDashboard.

private void showDashboard(int date, GBDevice device) {
    FragmentManager fm = getActivity().getSupportFragmentManager();
    ActivityListingDashboard listingDashboardFragment = ActivityListingDashboard.newInstance(date, device);
    listingDashboardFragment.show(fm, "activity_list_total_dashboard");
}
Also used : FragmentManager(androidx.fragment.app.FragmentManager)

Aggregations

FragmentManager (androidx.fragment.app.FragmentManager)170 FragmentTransaction (androidx.fragment.app.FragmentTransaction)55 Fragment (androidx.fragment.app.Fragment)42 Bundle (android.os.Bundle)28 Test (org.junit.Test)15 Intent (android.content.Intent)13 FragmentActivity (androidx.fragment.app.FragmentActivity)10 Activity (android.app.Activity)6 View (android.view.View)6 DialogFragment (androidx.fragment.app.DialogFragment)6 TaskRetainerFragment (com.owncloud.android.ui.fragment.TaskRetainerFragment)5 ArrayList (java.util.ArrayList)5 Context (android.content.Context)4 DialogInterface (android.content.DialogInterface)3 LayoutInflater (android.view.LayoutInflater)3 MenuInflater (android.view.MenuInflater)3 Window (android.view.Window)3 TextView (android.widget.TextView)3 ViewModelProvider (androidx.lifecycle.ViewModelProvider)3 SslUntrustedCertDialog (com.owncloud.android.ui.dialog.SslUntrustedCertDialog)3