How to add the custom button on google's(devic

2019-07-14 18:16发布

I want to add one button on google(device)'s native application Like(Google Map),Using this button I want to open my application.

I have do some work regarding that.

  • Using AccessibilityService I find the which application still running using this service I open the stand alone dialog using SYSTEM_ALERT_WINDOW permission. But the dialog cover whole screen , I manage to display this dialog in screen bottom side, but still I can't do anything in device native application like (google map), because my dialog is contain those touch, I checked the activity stack using terminal ,I found that still my application is top of the stack.

Now After two day (Saturday/Sunday) research I can't find the any suitable solution regarding this.

I'm stuck.

1条回答
在下西门庆
2楼-- · 2019-07-14 19:06

As per my understanding, you want to show a UI on top of google application but once your UI is evoked you are not able to send the touch to the google application over which you evoked your UI which is very obvious as focus is now on your UI. I'll suggest you to use a Service and bind your UI to it and use WindowManager.LayoutParams with appropriate flags. You can follow this link

https://github.com/henrychuangtw/Android-ChatHead/blob/master/app/src/main/java/henrychuang/tw/chatheadmsg/ChatHeadService.java

to get an idea how to do it. Instead of chathead UI you have to use your UI.

查看更多
登录 后发表回答