@Override
  public void onPause() {
    super.onPause();

    MainActivity.userBusyNow = false;

    if (mBroadcaster != null) mBroadcaster.onHostActivityPaused();
    stopMonitoringOrientation();
  }
  @Override
  public void onResume() {
    super.onResume();

    MainActivity.userBusyNow = true;

    if (mBroadcaster != null) {
      mBroadcaster.onHostActivityResumed();

      if (!mBroadcaster.isRecording()) {
        setBannerToBufferingState();
        mBroadcaster.startRecording();
      }
    }
    //        startMonitoringOrientation();
  }
 @Override
 public void onCreate(Bundle savedInstanceState) {
   if (VERBOSE) Log.i(TAG, "onCreate");
   super.onCreate(savedInstanceState);
   if (!Kickflip.readyToBroadcast()) {
     Log.e(
         TAG,
         "Kickflip not properly prepared by BroadcastFragment's onCreate. SessionConfig: "
             + Kickflip.getSessionConfig()
             + " key "
             + Kickflip.getApiKey()
             + " secret "
             + Kickflip.getApiSecret());
   } else {
     setupBroadcaster();
   }
 }
 @Override
 public void onDestroy() {
   super.onDestroy();
   if (mBroadcaster != null && !mBroadcaster.isRecording()) mBroadcaster.release();
 }
 @Override
 public void onStop() {
   super.onStop();
 }
 @Override
 public void onStart() {
   super.onStart();
 }
 @Override
 public void onAttach(Activity activity) {
   super.onAttach(activity);
   getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
   if (VERBOSE) Log.i(TAG, "onAttach");
 }