Martynas Jurkus
Martynas Jurkus

Reputation: 9301

How to test services declared in AndroidManifest.xml with Robolectric 2

I have a service declared in my AndroidManifest.xml

<service android:name="com.test.app.Service" android:exported="false"/>

During test, when I try to get it like this - I get empty list.

final Intent intent = new Intent(context, Service.class);
List<ResolveInfo> result = context.getPackageManager().queryIntentServices(intent , 0);

What am I missing?

Upvotes: 0

Views: 387

Answers (1)

Martynas Jurkus
Martynas Jurkus

Reputation: 9301

It's not possible at the moment. Robolectric issue.

Upvotes: 1

Related Questions