简体   繁体   English

android有没有办法以编程方式拍摄家庭和其他应用程序的屏幕快照?

[英]android is there a way to take screenshot of home and other apps that are not yours programmatically?

I already made a button to be overlaid in the system window, only thing is I don't know how to take screenshot programmatically from that button to take screenshot of home screen or any other screen (not my activity). 我已经做了一个要覆盖在系统窗口中的按钮,唯一的是我不知道如何从该按钮以编程方式获取屏幕快照以获取主屏幕或任何其他屏幕的屏幕快照(不是我的活动)。

What I want is how to programmatically run the combo keys to initiate the screenshot? 我想要的是如何以编程方式运行组合键以启动屏幕截图? (like pressing both power and volume down key at the same to take screenshot) (例如,同时按下电源和降低音量键以截取屏幕截图)

I know using adb command required root (which I don't want to) , you can using getrootview but only inside your own activity (which I don't want to) . 我知道使用adb命令需要root(我不想) ,您可以使用getrootview,但只能在您自己的活动中使用(我不想)

Android Lollipop (5.0)开始,您可以使用MediaProjection截屏。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM