At "Bitmap tmp = (Bitmap) extras.get("data");" in the following I get warning: [deprecation] get(String) in BaseBundle has been deprecated:
startActivityForResult = registerForActivityResult(
new ActivityResultContracts.StartActivityForResult(),
result -> {
if (result.getResultCode() == Activity.RESULT_OK) {
Intent data = result.getData();
if (data != null) {
// There are no request codes
Bundle extras = data.getExtras();
if (extras != null) {
Bitmap tmp = (Bitmap) extras.get("data");
if (tmp != null) {
encodeBitmapAndSaveToFirebase(tmp);
imageBtnRotateProfileImage.setVisibility(View.VISIBLE);
imageBtnDeleteProfileImage.setVisibility(View.VISIBLE);
}
}
}
}
}
);
Tried this too but also deprecated Bitmap tmp = (Bitmap) data.getParcelableExtra("data");
I know I should use a specific type-safe method, but how?
Solution as instructed by Edric