I have an activity with two fragments, Fragment A and Fragment B. I want to show a view hidden in Fragment A when the user touches a button in fragment B. How can I do this? I have tried to get the whole layout of the activity and get the view but I get a null pointer exception.
My activity layout is as shown below
This is the line I am using. It throws a null pointer exception.
shadowLine = getActivity().findViewById(R.id.shadowLine);
shadowLine.setVisibility(View.VISIBLE);