去掉短剧页面的顶部状态栏,修复闪退bug

This commit is contained in:
hch 2024-01-23 17:49:37 +08:00
parent 0a70cc027f
commit 3effb630c5
2 changed files with 9 additions and 1 deletions

View File

@ -1,5 +1,7 @@
package com.yunbao.main.activity;
import android.view.Window;
import android.view.WindowManager;
import android.widget.LinearLayout;
import androidx.fragment.app.FragmentManager;
@ -25,8 +27,10 @@ public class MainHomeCommunityActivity extends AbsActivity {
@Override
protected void main() {
MainHomeCommunityVideoFragment communityVideoFragment = new MainHomeCommunityVideoFragment();
Window window = getWindow();
window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
MainHomeCommunityVideoFragment communityVideoFragment = new MainHomeCommunityVideoFragment();
FragmentManager FM = getSupportFragmentManager();//获取管理器
FragmentTransaction FT = FM.beginTransaction();//获取启动器
FT.replace(R.id.fragment, communityVideoFragment);//替换碎片

View File

@ -204,6 +204,10 @@ public class MainHomeCommunityVideoFragment extends BaseFragment {
@Override
public void onDestroy() {
super.onDestroy();
if (timer != null) {
timer.cancel();
timer = null;
}
getActivity().finish();
}