protected void shareScreenShot() throws IOException { | |
final Intent shareIntent = new Intent(Intent.ACTION_SEND); | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | |
shareIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT); | |
} else { | |
shareIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); | |
shareIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); | |
} | |
shareIntent.setType("image/jpeg"); | |
shareIntent.putExtra(Intent.EXTRA_STREAM, takeScreenShot()); | |
startActivity(Intent.createChooser(shareIntent, getString(R.string.send_to))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment