Reputation: 3298
I am trying to access the activity using my fragment.
This is how I am accessing it:
RelativeLayout titleBar = (RelativeLayout) getActivity().findViewById(R.id.pullupTitleBar);
titleBar.setVisibility(View.INVISIBLE);
the activities view does not change invisible though. Also tried View.GONE. What am I doing wrong?
Upvotes: 0
Views: 29
Reputation: 3298
the answer was to actually do it the other way round and access the fragment from the activity instead!
Upvotes: 0
Reputation: 648
You have to use:
getActivity().getWindow().getDecorView().findViewById(R.id.pullupTitleBar);
Upvotes: 1