I tried this: ((MainActivity) getActivity (). GetSupportFragmentManager (). BeginTransaction (). Remove (this);
But so a mistake.
I tried this: ((MainActivity) getActivity (). GetSupportFragmentManager (). BeginTransaction (). Remove (this);
But so a mistake.
It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:
remove (android.support v4.app.Fragmernt) in FragmentTransaction cannot be applied to (anonimus android.view.View.onclicklistener)
If you did this inside the listner, this refers not to your Fragment, but to an instance of an anonymous class, which is your listner. You need
....remove(YorFragment.this) What a mistake, you do not write, but just forgot .commit() at the end of this expression.
Source: https://ru.stackoverflow.com/questions/619463/
All Articles