Change your onCreate()
to call support methods instead of standard ones, as:
supportRequestWindowFeature(Window.FEATURE_PROGRESS);
supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.activity_main);
setSupportProgressBarIndeterminate(true);
And also when you want to display the progress:
getActivity().setSupportProgressBarVisibility(false);