how to get a fragment added in an XML layout

You can get the fragment instance as follows:

getSupportFragmentManager().findFragmentById(R.id.yourFragmentId)

Leave a Comment