Any way to disable/override the mutitask button on Galaxy Tab 4? [duplicate]

旧街凉风 提交于 2019-12-22 08:44:08

问题


We have an industrial control app we write and ship pre-loaded on Samsung Galaxy Tablets with our manufacturing products.

The tablets we were using were Tab 10's which ran Honeycomb, but we can't get enough of those to OEM anymore so we're switching to Tab 4's which run KitKat. The new tablets have a button which looks like the old menu button - two overlapping rectangles - but it's different functionality - it's called the "multi-task" button and it brings up a task-switcher/task-killer.

We'd like to programmatically disable that or override it with different behavior. How do we do that? Is this a feature of KitKat, or is it a Samsung customization that we can't get programmatic access to?


回答1:


As far as I know -- no, you are not allowed to override system controls from an app.

You can probably achieve this with a ROM mod though. : )

Here are a few related links:

Android Override multitasking-key

How to ignore button click of “Recent Activity Button” in android 3.0




回答2:


This code works for me. Actually, you cannot disable task button. When you press it, your activity calls onPause() method and you can move your task to the front in this method. See my answer for related question.

@Override
protected void onUserLeaveHint() {
    super.onUserLeaveHint();
    ((ActivityManager) getApplicationContext().getSystemService(Context.ACTIVITY_SERVICE)).moveTaskToFront(getTaskId(), 0);
}

@Override
protected void onPause() {
    super.onPause();
    ((ActivityManager) getApplicationContext().getSystemService(Context.ACTIVITY_SERVICE)).moveTaskToFront(getTaskId(), 0);
}


来源:https://stackoverflow.com/questions/28436357/any-way-to-disable-override-the-mutitask-button-on-galaxy-tab-4

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