I should be able to press a button that takes a screenshot of the current activity (without showing the Toast message on the display) and then opens the dialog to share it on social networks or various apps. I hope you got what I need to do and you can help me.
Asked
Active
Viewed 775 times
-1
-
1Your Activity or Activity of the current app the user is looking at? – DeeV Jul 21 '16 at 22:13
-
An Activity where a a score of a card game is shown. @DeeV – Alessio Luciani Jul 21 '16 at 22:21
1 Answers
0
How to take a screenshot programatically
After that, you can send a share intent with the screen shot image uri attached.
Like so:
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_STREAM, uriToImage);
shareIntent.setType("image/jpeg");
startActivity(Intent.createChooser(shareIntent, getResources().getText(R.string.send_to)));

Community
- 1
- 1

confusedProgrammer
- 77
- 2
- 12