I'm trying to use the new Activity Results API to replace startActivityForResult. If I call registerForActivityResult in a Fragment everything is OK. However if I call the same method in an AppCompatActivity the IDE displays an "unresolved reference" error. Anyway the app builds with no errors an runs as expected. How to remove that "unresolved reference" error in the IDE?
I use: import androidx.activity.result.contract.ActivityResultContracts import androidx.appcompat.app.AppCompatActivity
dependencies: "androidx.activity:activity-ktx:${versions.activity_ktx}" "androidx.fragment:fragment-ktx:${versions.fragment_ktx}"