Skip to content

Instantly share code, notes, and snippets.

@Binary-Finery
Last active October 2, 2018 06:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Binary-Finery/782f1b96adf5c348324db7a83819f25c to your computer and use it in GitHub Desktop.
Save Binary-Finery/782f1b96adf5c348324db7a83819f25c to your computer and use it in GitHub Desktop.
shre image to activty
Intent intent = getIntent();
String action = intent.getAction();
String type = intent.getType();
if (Intent.ACTION_SEND.equals(action)) {
if (type != null) {
Uri imageUri = intent.getParcelableExtra(Intent.EXTRA_STREAM);
if (imageUri != null) {
imageView.setImageURI(imageUri);
generatePalette();
} else {
errorMessage();
}
} else {
errorMessage();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment