Java Code Examples for android.content.IntentFilter#getPriority()

The following examples show how to use android.content.IntentFilter#getPriority() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
private static ResolveInfo newResolveInfo(ServiceInfo serviceInfo, IntentFilter intentFilter) {
        ResolveInfo resolveInfo = new ResolveInfo();
        resolveInfo.serviceInfo = serviceInfo;
        resolveInfo.filter = intentFilter;
        resolveInfo.resolvePackageName = serviceInfo.packageName;
        resolveInfo.labelRes = serviceInfo.labelRes;
        resolveInfo.icon = serviceInfo.icon;
        resolveInfo.specificIndex = 1;
//        if (VERSION.SDK_INT >= VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
//          默认就是false,不用再设置了。
//        resolveInfo.system = false;
//        }
        resolveInfo.priority = intentFilter.getPriority();
        resolveInfo.preferredOrder = 0;
        return resolveInfo;
    }
 
Example 2
private static ResolveInfo newResolveInfo(ActivityInfo activityInfo, IntentFilter intentFilter) {
        ResolveInfo resolveInfo = new ResolveInfo();
        resolveInfo.activityInfo = activityInfo;
        resolveInfo.filter = intentFilter;
        resolveInfo.resolvePackageName = activityInfo.packageName;
        resolveInfo.labelRes = activityInfo.labelRes;
        resolveInfo.icon = activityInfo.icon;
        resolveInfo.specificIndex = 1;
//        if (VERSION.SDK_INT >= VERSION_CODES.ICE_CREAM_SANDWICH) {
////            默认就是false,不用再设置了。
//            resolveInfo.system = false;
//        }
        resolveInfo.priority = intentFilter.getPriority();
        resolveInfo.preferredOrder = 0;
        return resolveInfo;
    }
 
Example 3
@TargetApi(VERSION_CODES.KITKAT)
    private static ResolveInfo newResolveInfo(ProviderInfo providerInfo, IntentFilter intentFilter) {
        ResolveInfo resolveInfo = new ResolveInfo();
        resolveInfo.providerInfo = providerInfo;
        resolveInfo.filter = intentFilter;
        resolveInfo.resolvePackageName = providerInfo.packageName;
        resolveInfo.labelRes = providerInfo.labelRes;
        resolveInfo.icon = providerInfo.icon;
        resolveInfo.specificIndex = 1;
//      默认就是false,不用再设置了。
//        resolveInfo.system = false;
        resolveInfo.priority = intentFilter.getPriority();
        resolveInfo.preferredOrder = 0;
        return resolveInfo;
    }