resolveActivity return null but startActivity works if not checking

The button is always disabled if I put checking before setting the onClickListener. Doesn’t matter if I use queryIntentActivity, resolveActiviy or just use intent.resolveActivity they all return null or empty content back. The strange thing is startActivity works fine that Contacts App launched and I could select a contact and query its display name without any problem. Can anyone give me a hand? Thanks.

btnSelectSuspect.apply {
val pickIntent = Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI)
val packageManager = requireActivity().packageManager
val resolverInfo = packageManager.queryIntentActivities(pickIntent, PackageManager.MATCH_DEFAULT_ONLY)
if (resolverInfo == null || resolverInfo.size == 0)
this.isEnabled = false;
else
setOnClickListener {
startActivityForResult(pickIntent, REQUEST_CONTACT)
}
}

Gradle file:

apply plugin: ‘com.android.application’
apply plugin: ‘kotlin-android’
apply plugin: ‘kotlin-android-extensions’
apply plugin: ‘kotlin-kapt’

android {
compileSdkVersion 30
buildToolsVersion “30.0.2”

defaultConfig {
    applicationId "com.ibm.test.criminalintent"
    minSdkVersion 21
    targetSdkVersion 30
    versionCode 1
    versionName "1.0"

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}

}

dependencies {
implementation fileTree(dir: “libs”, include: ["*.jar"])
implementation “org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version”
implementation ‘androidx.core:core-ktx:1.3.1’
implementation ‘androidx.appcompat:appcompat:1.2.0’
implementation ‘androidx.constraintlayout:constraintlayout:2.0.1’
implementation ‘androidx.lifecycle:lifecycle-extensions:2.2.0’
implementation ‘androidx.legacy:legacy-support-v4:1.0.0’
implementation ‘androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0’
implementation ‘androidx.recyclerview:recyclerview:1.1.0’
implementation ‘androidx.room:room-runtime:2.2.5’
kapt ‘androidx.room:room-compiler:2.2.5’
testImplementation ‘junit:junit:4.12’
androidTestImplementation ‘androidx.test.ext:junit:1.1.2’
androidTestImplementation ‘androidx.test.espresso:espresso-core:3.3.0’

}

It only happened on the enumerator, in the real device it works.