Last active
October 2, 2018 06:40
-
-
Save Binary-Finery/782f1b96adf5c348324db7a83819f25c to your computer and use it in GitHub Desktop.
shre image to activty
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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