Chatting in Android fullscreen live streaming

enter image description here
Chatting in Android fullscreen live streaming mode causes UI to crash when the keyboard is raised. I tried various things but couldn't find a way.

** WowzaActivity

When I turn on live broadcasts and try to chat, the ui crashes on the keyboard. After switching the camera, the UI is returned normally and the UI is not broken even after chatting again. By giving threads to the initial setting, the UI could not be fixed on the initial screen.

enter code here
 public class WowzaActivity extends AppCompatActivity implements 
  View.OnClickListener, WOWZStatusCallback, 
  WOWZBroadcastStatusCallback {
private static final String CHANNEL_URL = " ";
private static final String MESSAGE = " ";
private static final String UNIQUE_HANDLER_ID = " ";


private LiveReadyFragment liveReadyFragment;
private LiveFragment liveFragment;

private long backKeyPressedTime = 0;
private boolean liveStatus = false;

// The top-level GoCoder API interface
private WowzaGoCoder goCoder;
// The GoCoder SDK camera view
private WOWZCameraView goCoderCameraView;
// The GoCoder SDK audio device
private WOWZAudioDevice goCoderAudioDevice;
// The GoCoder SDK broadcaster
private WOWZBroadcast goCoderBroadcaster;
// The broadcast configuration settings
private WOWZBroadcastConfig goCoderBroadcastConfig;

// Properties needed for Android 6+ permissions handling
private static final int PERMISSIONS_REQUEST_CODE = 0x1;
private boolean mPermissionsGranted = true;
private String[] mRequiredPermissions = new String[]{
        Manifest.permission.CAMERA,
        Manifest.permission.RECORD_AUDIO

};
Handler handler = new Handler();


private View decorView;
private int uiOption;
private Timer timer;

Runnable r = new Runnable() {
    @Override
    public void run() {

        if (!goCoderCameraView.getCamera().isFront()) {
            goCoderCameraView.switchCamera();
        }

    }
};
Runnable i = new Runnable() {
    @Override
    public void run() {
        if (!goCoderCameraView.getCamera().isBack()) {
            goCoderCameraView.switchCamera();
        }

    }
};

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_wowza);
    AndroidBug5497Workaround.assistActivity(this);
    getWindow().addFlags
  (WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);









  getWindow().clearFlags
 (WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
    hideSystemUI(getWindow());

    // 최초 카메라 Preview가 켜졌을 때
    handler.postDelayed(i, 10000);

    setWowza();





    liveReadyFragment = new LiveReadyFragment();
    liveFragment = new LiveFragment();

    addFragment(liveReadyFragment);


    liveReadyFragment.setWowzaActivityInterface(new 
   WowzaActivityInterface() {
        @Override
        public void onClickLiveButton() {
            addFragment(liveFragment);
            liveReadyFragment.setHidden(true);
            startStreaming();
            liveStatus = true;
        }


    });

    liveFragment.setWowzaActivityInterface(new 
   WowzaActivityInterface() {

        @Override
        public void onClickCloseButton() {
            backFragment();
            liveReadyFragment.setHidden(false);
            stopStreaming();
            liveStatus = false;
        }

        @Override
        public void onClickChangeButton() {
            if (!goCoderCameraView.getCamera().isFront()) {
                goCoderCameraView.switchCamera();
            } else if (!goCoderCameraView.getCamera().isBack()) {
                goCoderCameraView.switchCamera();
            }
        }
    });



    goCoder = WowzaGoCoder.init(getApplicationContext(), "GOSK-1047- 
    010C-32B7-41A5-3100");

    if (goCoder == null) {
        // If initialization failed, retrieve the last error and 
     display it
        WOWZError goCoderInitError = WowzaGoCoder.getLastError();
        Toast.makeText(this,
                "GoCoder SDK error: " + 
    goCoderInitError.getErrorDescription(),
                Toast.LENGTH_LONG).show();
        return;
    }

    goCoderAudioDevice = new WOWZAudioDevice();
    // Associate the WOWZCameraView defined in the U/I layout with 
   the corresponding class member
    goCoderCameraView = (WOWZCameraView) 
  findViewById(R.id.camera_preview);


}


enter code here







  private void addFragment(Fragment fragment) {
    FragmentManager fragmentManager = getSupportFragmentManager();
    FragmentTransaction fragmentTransaction = 
  fragmentManager.beginTransaction();
    fragmentTransaction.addToBackStack("live");
    fragmentTransaction.add(R.id.flContainer, fragment).commit();
}

private void backFragment() {
    FragmentManager fragmentManager = getSupportFragmentManager();
    if(fragmentManager.getBackStackEntryCount() > 0) {
        fragmentManager.popBackStack();
    }

}



@Override
public void onWindowFocusChanged(boolean hasFocus) {
    super.onWindowFocusChanged(hasFocus);
    hideSystemUI(getWindow());
}

public static void hideSystemUI(Window window) {
    window.getDecorView().setSystemUiVisibility(
            View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                    | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav 
  bar
                    | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status 
  bar
                    | View.SYSTEM_UI_FLAG_IMMERSIVE


    );
}




   protected void setWowza() {

    // If running on Android 6 (Marshmallow) and later, check to see 
  if the necessary permissions
    // have been granted
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        mPermissionsGranted = hasPermissions(this, 
 mRequiredPermissions);
        if (!mPermissionsGranted)
    ActivityCompat.requestPermissions(this, mRequiredPermissions, 
  PERMISSIONS_REQUEST_CODE);
    } else
        mPermissionsGranted = true;

    // Start the camera preview display
    if (mPermissionsGranted && goCoderCameraView != null) {
        if (goCoderCameraView.isPreviewPaused())
            goCoderCameraView.onResume();
        else
            goCoderCameraView.startPreview();

  goCoderCameraView.setScaleMode(WOWZMediaConfig.RESIZE_TO_ASPECT);
    }
    // Create a broadcaster instance
    goCoderBroadcaster = new WOWZBroadcast();

    // Create a configuration instance for the broadcaster
    goCoderBroadcastConfig = new 
   WOWZBroadcastConfig(WOWZMediaConfig.FRAME_SIZE_1920x1080);

    goCoderBroadcastConfig.setHostAddress("applr.fastedge.net");
    goCoderBroadcastConfig.setPortNumber(1935);
    goCoderBroadcastConfig.setApplicationName("alive");
    goCoderBroadcastConfig.setStreamName("applr");


    // Designate the camera preview as the video broadcaster
    goCoderBroadcastConfig.setVideoBroadcaster(goCoderCameraView);

    // Designate the audio device as the audio broadcaster
    goCoderBroadcastConfig.setAudioBroadcaster(goCoderAudioDevice);

    // Associate the onClick() method as the callback for the 
 broadcast button's click event

    handler.postDelayed(r, 5000);

}



  enter code here`ActivityCompat.requestPermissions() to interpret



  public void startStreaming() {
    if (mPermissionsGranted && goCoderCameraView != null) { 
        if (goCoderCameraView.isPreviewPaused())
            goCoderCameraView.onResume();
        else
            goCoderCameraView.startPreview();
    }

     if (!mPermissionsGranted) return;

    // Ensure the minimum set of configuration settings have been 
    specified necessary to
    // initiate a broadcast streaming session
    WOWZStreamingError configValidationError = 
     goCoderBroadcastConfig.validateForBroadcast();

    if (configValidationError != null) {
        Toast.makeText(this, 
   configValidationError.getErrorDescription(), 
      Toast.LENGTH_LONG).show();
    } else if (goCoderBroadcaster.getStatus().isBroadcasting()) {
        // Stop the broadcast that is currently broadcasting
        goCoderBroadcaster.endBroadcast(this);
    } else {
        // Start streaming
        goCoderBroadcaster.startBroadcast(goCoderBroadcastConfig, 
 this);
    }
}

public void stopStreaming() {
    goCoderBroadcaster.endBroadcast();
}

@Override
protected void onResume() {
    super.onResume();

    if (!goCoderBroadcaster.getStatus().isBroadcasting()) {
    }
}

//
@Override
public void onRequestPermissionsResult(int requestCode, String 
  permissions[], int[] grantResults) {
    mPermissionsGranted = true;
    switch (requestCode) {
        case PERMISSIONS_REQUEST_CODE: {
            // Check the result of each permission granted
            for(int grantResult : grantResults) {
                if (grantResult != PackageManager.PERMISSION_GRANTED) 
  {
                    mPermissionsGranted = false;
                  }
               }
           }
       }
    }



  private static boolean hasPermissions(Context context, String[] 
   permissions) {
    for(String permission : permissions)
        if (context.checkCallingOrSelfPermission(permission) != 
  PackageManager.PERMISSION_GRANTED)
            return false;

    return true;
  }








  @Override
  public void onClick(View view) {
    // return if the user hasn't granted the app the necessary 
   permissions
    if (!mPermissionsGranted) return;

    // Ensure the minimum set of configuration settings have been 
 specified necessary to
    // initiate a broadcast streaming session
    WOWZStreamingError configValidationError = 
   goCoderBroadcastConfig.validateForBroadcast();

    if (configValidationError != null) {
        Toast.makeText(this, 
 configValidationError.getErrorDescription(), 
  Toast.LENGTH_LONG).show();
    } else if (goCoderBroadcaster.getStatus().isBroadcasting()) {
        // Stop the broadcast that is currently broadcasting
        goCoderBroadcaster.endBroadcast(this);
    } else {
        // Start streaming
        goCoderBroadcaster.startBroadcast(goCoderBroadcastConfig, 
   this);
    }
  }