0

I want to take a screenshot of an Activity of my application, but I do not have the code of that activity (only its class file since it is imported from an external API) so am not able to modify the UI and add an event which will help me taking the screenshot.

Thus, I thought about using a background Service which can detect all application's activities and to take the screenshot if matching the wanted activity with some condition.

I have browsed many question/answers about the subject, but nothing matched what I want to do.

So, I will be very grateful for any help, or suggestion about this.

Thank you.

ChuongPham
  • 4,761
  • 8
  • 43
  • 53
GB11
  • 175
  • 1
  • 18
  • thank God its impossible – pskink Nov 27 '14 at 14:09
  • Why is it impossible ?? – GB11 Nov 27 '14 at 15:12
  • would you like to log to your gmail account while some service takes your screen with login/password and sends the screenshot to my mailbox? – pskink Nov 27 '14 at 15:16
  • if the activity is running in your own application, you can get the current one http://stackoverflow.com/questions/11411395/how-to-get-current-foreground-activity-context-in-android and render the view to a bitmap http://code.neenbedankt.com/how-to-render-an-android-view-to-a-bitmap/ – eduyayo Nov 27 '14 at 16:41
  • Thank you Eduyayo, i will try it, the activity is running in my own application – GB11 Nov 29 '14 at 22:44

0 Answers0