7的所有home键和任务栏功能

7的所有home键和任务栏功能

本文介绍了禁止在Nexus 7的所有home键和任务栏功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立一个应用程序,将形成一个展览的一部分。它将被显示在将要牢固地安装一个的Nexus 7。该应用程序具有触摸屏功能,并会显示交互式内容。

I am building an app that will form part of an exhibition. It will be displayed on a Nexus 7 which will be securely mounted. The app has touchscreen functionality and will display interactive content.

我需要能够禁用尽可能多的功能越好,同时展出的,因为我不希望公众能够得到以外的任何应用程序。

I need to be able to disable as many features as possible whilst on display as I do not want the public to be able to get to anything other than the app.

主要的事情,我挣扎着是后面的/ home /最近的应用程序列表按钮。我发现禁用home键(童锁Android - 是否有可能禁用的home键点击),但理想的我需要的按钮,是无形的,所以关闭了光晕(黑就可以了)。

The main thing I am struggling with is the back/home/recent app list button. I have found some examples of disabling home button (child lock Android - Is It possible to disable the click of home button) but ideally I need the buttons to be invisible, so to turn off the 'glow' (black would be fine).

是一台Nexus 7以某种方式保护的底部,有另一种版本的Andr​​oid,让我做到这一点? Nexus的设备将只被用于显示这个程序,没有其他的功能是必要的。

Is the bottom section on a Nexus 7 protected in some way, is there another version of Android that would allow me to do this? The Nexus device will only be used for displaying this app, no other functionality is needed.

任何建议将是伟大的,非常多的AP preciated。

Any suggestions would be great and very much appreciated.

推荐答案

而无需创建你自己定制的Andr​​oid ROM,除去底部的按钮,你的最佳解决方案,将是使应用程序全屏,覆盖后退按钮,让你的应用程序启动器,以覆盖主页按钮。

Your best solution without creating your own custom Android rom to remove the bottom buttons, will be to make the app full screen, override the back button, and make your app a launcher in order to override the home button.

AFAIK,有没有办法覆盖的应用程序近期按钮。

AFAIK, there is no way of overriding the recent apps button.

编辑:另外一个选择是有一个全屏幕应用程序,然后使用一个安装,将覆盖按钮。 (感谢MaciejGórski的想法)。

One other option would to have a fullscreen app and then use a mount that will cover the buttons. (Thanks to MaciejGórski for the idea).

为了让您的应用程序全屏,放在下面的活动的的onCreate()

To make your app full screen, put the following in your activity's onCreate():

requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

或者你也可以从内部清单,以及使应用程序全屏显示,得益于@Niels:

Or you can make the app full screen from within the manifest as well, thanks to @Niels:

<application android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen">

要覆盖后退按钮,添加这个方法:

To override the back button, add this method:

@Override
public void onBackPressed() {
    return;
}

现在home键是棘手,以下内容添加到您的清单:

Now the home button is trickier, add the following to your manifest:

 <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>

这下你的清单中的&LT;活性GT;

<intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.HOME" />
            <category android:name="android.intent.category.DEFAULT" />
</intent-filter>

这下你的清单中的&lt;应用&GT; ,确保了&LT;接收器名称&gt; 是完整的包名路径定义:

and this to your manifest under the <application>, make sure that the <receiver name> is the full package name path you define:

<receiver android:name="com.example.BootCompleteReceiver">
   <intent-filter>
        <action android:name="android.intent.action.BOOT_COMPLETED" />
   </intent-filter>
</receiver>

最后,创建一个名为 BootCompleteReceiver 的Java类文件,并使用此code:

And lastly, create a java class file called BootCompleteReceiver, and use this code:

public class BootCompleteReceiver extends BroadcastReceiver {

@Override
public void onReceive(Context context, Intent intent) {
    Intent startActivityIntent = new Intent(context, YourActivityName.class);
    startActivityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(parentActivityIntent);
  }
}

要在以后禁用应用程序的主屏幕发射器,preSS最近应用程序按钮,刷卡从右侧下,点击设置,进入应用程序,然后点击右上角的三个点(垂直排列),preSS复位程序preferences,最后preSS复位应用程序。

To later disable your app as a home screen launcher, press the recent app button, swipe down from the right side, tap settings, go to apps, then tap the upper right three dots (vertically aligned), press "Reset app preferences", and then finally press "Reset apps".

我觉得应该差不多涵盖了一切。

I think that should just about cover it all.

修改2 我才意识到/测试,你不一定需要 BOOT_COMPLETED 的意图,如果你让你的应用程序启动器。这意味着&LT;使用-许可&GT; &LT;接收器&GT; BootComplete的.java 是不需要的。你可以只用&LT;意向滤光器&gt; ,其中包括主,HOME和默认属性

EDIT 2 I just realized/tested and you do NOT necessarily need the BOOT_COMPLETED intent if you make your application a launcher. This means that the <uses-permission>, <receiver>, and BootComplete.java are not needed. You can just use the <intent-filter> that includes the MAIN, HOME, and DEFAULT attributes.

修改3 更多/不同的信息,请访问:Home启动问题重启后碎片

这篇关于禁止在Nexus 7的所有home键和任务栏功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 18:09