intent.resolveActivity returns null in API 30

This appears to be due to the new restrictions on “package visibility” introduced in Android 11. Basically, starting with API level 30, if you’re targeting that version or higher, your app cannot see, or directly interact with, most external packages without explicitly requesting allowance, either through a blanket QUERY_ALL_PACKAGES permission, or by including an appropriate … Read more

Android appllication stopping unfortunately

Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.nishant.textontym/com.example.nishant.textontym.ContactsFragment}; have you declared this activity in your AndroidManifest.xml? Your calling com.example.nishant.textontym.ContactsFragment activity which was not declared in the manifest or if ContactsFragment is a Fragment then you must add it to an activity, you can’t call via intent.