I want to retrieve all services matching a specific intent-filter. I have the following code :
AndroidManifest.xml of a TestService :
<service
android:name=".TestService"
android:exported="true"
android:permission="com.example.MY_PERMISSIONS"
>
<intent-filter>
<action android:name="com.example.myaction" />
<data
android:host="myhost"
android:scheme="https" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</service>
Querying the PackageManager in the application :
PackageManager packageManager = getPackageManager();
Intent intent = new Intent("com.example.myaction");
List<ResolveInfo> resolveInfos = packageManager.queryIntentServices(intent, 0);
Log.d(TAG,String.valueOf(resolveInfos.size()));
This returns a value = 0. I do not know what is the problem ?