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();
}
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();
}
}
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();
}
}
}
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();
}
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");
}
Aggregations