Home键关闭Home

由网友(不经风雨怎见彩虹)分享简介:我不知道这是病了建议采取对用户的Home键控制。但我正在开发用于教育目的的Andr​​oid应用程序锁定。我在浏览网站的时候来到这个link在禁用home键。@覆盖公共无效onAttachedToWindow(){。this.getWindow()的setType(WindowManager.LayoutParams...

我不知道这是病了建议采取对用户的Home键控制。但我正在开发用于教育目的的Andr​​oid应用程序锁定。我在浏览网站的时候来到这个link在禁用home键。

  @覆盖

公共无效onAttachedToWindow()
{
       。this.getWindow()的setType(WindowManager.LayoutParams.TYPE_KEYGUARD);
       super.onAttachedToWindow();
}
 

目前我使用的是上面的code禁用我的home键,然而,我发现,即使我有这个在我的onCreate

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

我无法删除我的通知栏中删除。 请指点。

解决方案

只需使用一个不同的主题,为您的活动。在您的Manifest.xml,设置活动的主题属性的android:主题=@安卓风格/ Theme.NoTitleBar.Fullscreen

无法连接App Store 用无线不行,用自己流量就可以

I do know that it is ill advice to take control of the HOME button for users. But I'm developing a android lockdown application for educational purposes. I was browsing the site and came upon this link on disabling the home button.

@override

public void onAttachedToWindow()
{  
       this.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);     
       super.onAttachedToWindow();  
}

Currently I'm using the above code to disable my home button, however I do notice that even though I have this in my onCreate

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

I am unable to remove my notification bar remove. Please advice.

解决方案

Just use a different theme for your activity. In your Manifest.xml, set the theme attribute of your activity to android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

阅读全文

相关推荐

最新文章