You do not want to do this in general. Fragment A and Fragment B should not directly communicate, since Fragment A and Fragment B may not both be on the screen at the same time all of the time. They might be side-by-side on a large screen but displayed via separate activities on smaller screens. IMHO, activities should mediate all communications between fragments. If you have two fragments that are too tightly coupled for that, they should not be separate fragments in the first place.
All that being said, you are getting a NullPointerException
because there is no fragment with that ID in the activity.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…