我可以在Android上禁用主页按钮吗 [英] Can I disable home button On Android

查看:61
本文介绍了我可以在Android上禁用主页按钮吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法禁用主页按钮,并且在android中它旁边的我尝试了此代码,但不起作用

I can not disable home button and Which is next to it in android I tried this code but does not work

 @Override
public void onAttachedToWindow() {
    this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
    super.onAttachedToWindow();
}

您有解决此问题的想法吗?或者我可以永远永久隐藏导航栏?

Do you have any idea for solve this problem? Or Can I hide navigation bar permanently forever؟

推荐答案

我找到了它.我从这里参加了如何在android中禁用主页按钮?并添加了最初存在的一行发射行如下:

I found it. I took a part from here how to disable home button in android? and added one row Which originally existed LAUNCHER row as follow:

<activity android:name=".MainActivity"
        android:clearTaskOnLaunch="true"
        android:excludeFromRecents="true"
        android:launchMode="singleTask"
        android:screenOrientation="portrait"
        android:stateNotNeeded="true" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.HOME" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.LAUNCHER"/>

        </intent-filter>
    </activity>

这篇关于我可以在Android上禁用主页按钮吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆