Refresh Fragment Him Self

2019-08-28 22:42发布

问题:

It's possible refresh an fragment him self? Like an activity

context.finish();
context.startActivity(context.getIntent());

回答1:

I haven't tested, but maybe something like

getActivity().getSupportFragmentManager().beginTransaction()
                .replace(R.id.the_fragment_container, new MyFragment())
                .commit();