Path to screenshots in Android

拥有回忆 提交于 2019-12-03 11:20:22

Android's API has no fixed path for screenshots but

File pix = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
File screenshots = new File(pix, "Screenshots");

might work. That's what ICS uses as path.

The "Screenshots" value is part of the private API.

Here is link to the source code where the value is set. Since the class is loaded in our application context there is no option to access the field. I'd hardcode it as @zapi suggested.

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