开发者

Disable call key in Android when application is running in background

I would like to disable the green (call) key in my application and it should work even when my application is switched to background task and when Acti开发者_如何学JAVAvity is paused. Should I use Android Service to disable the call key to achieve this ? If it is, then how to disable keys using Android Service. Please provide an insight on this.

Thank you.


Should I use Android Service to disable the call key to achieve this ?

You cannot "disable" any keys.

When you activity is in the foreground, you may be able to "disable" some keys by intercepting them in onKeyDown() -- I forget if the CALL button can be handled this way or not.

But, if you do not have an activity in the foreground, you have no rights to interfere with the user experience this way.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜