I am trying to upload the image on firebase storage and i am using the startActivityForResult with the intent and the request code but looks like it is deprecated. Is there any alternative for it. Code for reference
public void pickImage(View v)
{
Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(intent, 101);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode==101)
if (resultCode == RESULT_OK) {
localFileUri = data.getData();
ivProfile.setImageURI(localFileUri);
}
}