question: public static Intent implicit2ExplicitIntent ( Context context , Intent implicitIntent ) { PackageManager pm = context . getPackageManager ( ) ; List < ResolveInfo > resolveInfo = pm . queryIntentServices ( implicitIntent , 0 ) ; if ( resolveInfo == null || resolveInfo . size ( ) != 1 ) { return null ; } ResolveInfo serviceInfo = resolveInfo . get ( 0 ) ; String packageName = serviceInfo . serviceInfo . packageName ; String className = serviceInfo . serviceInfo . name ; ComponentName component = new ComponentName ( packageName , className ) ; Intent explicitIntent = new Intent ( implicitIntent ) ; explicitIntent . setComponent ( component ) ; return explicitIntent ; }
target:  Android L (lollipop, API 21) introduced a new problem when trying to invoke implicit intent, "java.lang.IllegalArgumentException: Service Intent must be explicit" <p/> If you are using an implicit intent, and know only 1 target would answer this intent, This method will help you turn the implicit intent into the explicit form. <p/> Inspired from SO answer: http://stackoverflow.com/a/26318757/1446466