How to take a screenshots?

后端 未结 1 1857
一向
一向 2020-12-20 06:00

I am developing an app which is able to take screen shots and I found the following code which allows me to do that

Toast.makeText(this, formattedDate, Toas         


        
相关标签:
1条回答
  • 2020-12-20 06:32

    in some cases having a ":" character in the filename is not allowed. You might want to replace it with "." or "-".

    EDIT:

    Try this:

    os.write(("/system/bin/screencap -p " + "\"/sdcard/"+formattedDate+".png\"").getBytes("ASCII"));
    
    0 讨论(0)
提交回复
热议问题