问题描述
我想在Android的屏幕截图,不论申请和没有生根手机。我已经看到到previous线程
我跟着这个指示,但他们是具体到一个应用程序。而我们需要改变每一个应用程序的布局文件。
I want to take a screen shot in android irrespective of the application and without rooting the phone. I have seen into the previous thread linkI followed this instructions but they are specific to one application. And we need to change the layout file of every application.
我也遇到了这是一个图书馆。有一件事是,我不清楚这是是否manifest.xml文件应为每个应用程序进行修改。
I also came across the link which is a library. One thing which is not clear to me in this is that whether the manifest.xml file should be changed for every application.
能否请您让我知道是否有任何其他方式的可能呢?我知道这是一个安全问题,但如果应用程序犯规的心意我需要采取的屏幕截图。
Can you please let me know if any other ways are possible? I know this is a security issue but if the application doesnt mind I need to take the screen shots.
感谢。
推荐答案
如果你不需要的状态栏(或键盘),你可以在你的活动做到这一点:
if you don't need the status bar (or keyboard) you can do this in your activity:
View root = findViewById(android.R.id.content);
root.setDrawingCacheEnabled(true);
Bitmap bm = Bitmap.createBitmap(root.getDrawingCache());
root.setDrawingCacheEnabled(false);
完全未经测试,但它应该工作。
Completely untested but it should work.
看到关于采取的,我不相信你想要的东西有可能不生根手机的其他应用程序的截图您的评论后。
After seeing your comment about taking screenshots of other applications I do not believe that what you want is possible without rooting the phone.
这篇关于如何采取在android系统拍摄的画面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!