After updating my app to AndroidX I noticed startActivityForResult() is depreciated. I looked through the documentation and found some good explanations, but I'm still confused as to how to handle request codes. I've tried adding the request code param to onActivityResult, but obviously that does not work. This is my old onActivityResult.
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_CODE_1) {
fetchTags();
} else if (requestCode == REQUEST_CODE_2) {
if (resultCode == RESULT_CANCELED) {
finish();
}
}
}
Do I need to create separate ActivityResultLaunchers for both request codes?