Hide status bar when sharing text android

泄露秘密 提交于 2021-02-11 12:44:57

问题


I have an app that i use this line to hide the status bar in all activities/dialogs

this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
                          WindowManager.LayoutParams.FLAG_FULLSCREEN);

The problem comes when i share text with

fun shareText(body: String) {
    val txtIntent = Intent(Intent.ACTION_SEND)
    txtIntent.type = "text/plain"
    intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
    txtIntent.putExtra(Intent.EXTRA_TEXT, body)
    startActivity(Intent.createChooser(txtIntent, getString(R.string.ShareVia)))
}

the status bar appears with the share dialog only , anyone knows how to hide it ?

来源:https://stackoverflow.com/questions/66039443/hide-status-bar-when-sharing-text-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!