Is it possible to create a custom floating text selection menu in Android versions pre Marshmallow?

☆樱花仙子☆ 提交于 2019-12-04 10:05:12

As you already noticed, using reflection is one of the ways. I'm pretty sure that it's the only one. If you're interested in what I did with that menu, check out Carbon. Its EditText does pretty much what you need, but with reflection as well.

The code snippet is way too long to paste it here, but here are the links:

https://github.com/ZieIony/Carbon/blob/master/carbon/src/main/java/carbon/widget/EditText.java https://plus.google.com/109054799904873578131/posts/BH6r9J5gnw6

Basically I'm hiding the fancy Samsung's menu, disable the standard Action Mode and show my own popup window with options connected to standard copy/paste click handlers.

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