Last active
October 23, 2021 21:34
-
-
Save carsonskjerdal/7efed2d248131f96273ca799865e89a2 to your computer and use it in GitHub Desktop.
ActivityResultLauncher implementation
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
private ActivityResultLauncher<Intent> pickerLauncher = registerForActivityResult( | |
new ActivityResultContracts.StartActivityForResult(), | |
new ActivityResultCallback<ActivityResult>() { | |
@Override | |
public void onActivityResult(ActivityResult result) { | |
if (result.getResultCode() == Activity.RESULT_OK) { | |
//image returned | |
} else { | |
//nothing returned | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment