In a fragment code I'd like to make ActionBar API calls such as
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
Is it a good idea to hold a reference to the activity in the fragment's code or is there a better way to approach this?
I'm using SherlockFragment for compatibility.
I just realized SherlockFragment has getActivity()
and getSherlockActivity()
methods, so I can write:
this.getActivity().requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
this.getSherlockActivity().setProgressBarIndeterminateVisibility(true);