當前位置: 首頁>>代碼示例>>Java>>正文


Java IntentFilter.countDataSchemes方法代碼示例

本文整理匯總了Java中android.content.IntentFilter.countDataSchemes方法的典型用法代碼示例。如果您正苦於以下問題:Java IntentFilter.countDataSchemes方法的具體用法?Java IntentFilter.countDataSchemes怎麽用?Java IntentFilter.countDataSchemes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.content.IntentFilter的用法示例。


在下文中一共展示了IntentFilter.countDataSchemes方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: findFilters

import android.content.IntentFilter; //導入方法依賴的package包/類
public ArrayList<F> findFilters(IntentFilter matching) {
	if (matching.countDataSchemes() == 1) {
		// Fast case.
		return collectFilters(mSchemeToFilter.get(matching.getDataScheme(0)), matching);
	} else if (matching.countDataTypes() != 0 && matching.countActions() == 1) {
		// Another fast case.
		return collectFilters(mTypedActionToFilter.get(matching.getAction(0)), matching);
	} else if (matching.countDataTypes() == 0 && matching.countDataSchemes() == 0 && matching.countActions() == 1) {
		// Last fast case.
		return collectFilters(mActionToFilter.get(matching.getAction(0)), matching);
	} else {
		ArrayList<F> res = null;
		for (F cur : mFilters) {
			if (filterEquals(cur.filter, matching)) {
				if (res == null) {
					res = new ArrayList<>();
				}
				res.add(cur);
			}
		}
		return res;
	}
}
 
開發者ID:7763sea,項目名稱:VirtualHook,代碼行數:24,代碼來源:IntentResolver.java

示例2: findFilters

import android.content.IntentFilter; //導入方法依賴的package包/類
public ArrayList<F> findFilters(IntentFilter matching) {
    if (matching.countDataSchemes() == 1) {
        // Fast case.
        return collectFilters(mSchemeToFilter.get(matching.getDataScheme(0)), matching);
    } else if (matching.countDataTypes() != 0 && matching.countActions() == 1) {
        // Another fast case.
        return collectFilters(mTypedActionToFilter.get(matching.getAction(0)), matching);
    } else if (matching.countDataTypes() == 0 && matching.countDataSchemes() == 0
            && matching.countActions() == 1) {
        // Last fast case.
        return collectFilters(mActionToFilter.get(matching.getAction(0)), matching);
    } else {
        ArrayList<F> res = null;
        for (F cur : mFilters) {
            if (filterEquals(cur, matching)) {
                if (res == null) {
                    res = new ArrayList<>();
                }
                res.add(cur);
            }
        }
        return res;
    }
}
 
開發者ID:TaRGroup,項目名稱:IFWManager,代碼行數:25,代碼來源:IntentResolver.java

示例3: findFilters

import android.content.IntentFilter; //導入方法依賴的package包/類
public ArrayList<F> findFilters(IntentFilter matching) {
	if (matching.countDataSchemes() == 1) {
		// Fast case.
		return collectFilters(mSchemeToFilter.get(matching.getDataScheme(0)), matching);
	} else if (matching.countDataTypes() != 0 && matching.countActions() == 1) {
		// Another fast case.
		return collectFilters(mTypedActionToFilter.get(matching.getAction(0)), matching);
	} else if (matching.countDataTypes() == 0 && matching.countDataSchemes() == 0 && matching.countActions() == 1) {
		// Last fast case.
		return collectFilters(mActionToFilter.get(matching.getAction(0)), matching);
	} else {
		ArrayList<F> res = null;
		for (F cur : mFilters) {
			if (filterEquals(cur, matching)) {
				if (res == null) {
					res = new ArrayList<>();
				}
				res.add(cur);
			}
		}
		return res;
	}
}
 
開發者ID:codehz,項目名稱:container,代碼行數:24,代碼來源:IntentResolver.java

示例4: buildTitle

import android.content.IntentFilter; //導入方法依賴的package包/類
String buildTitle(IntentFilter filter) {
    StringBuilder buf=new StringBuilder();
    boolean first=true;

    if (filter.countActions() > 0) {
        for (String action : in(filter.actionsIterator())) {
            if (first) {
                first=false;
            }
            else {
                buf.append('/');
            }

            buf.append(action.replaceAll("android.intent.action.", ""));
        }
    }

    if (filter.countDataTypes() > 0) {
        first=true;

        for (String type : in(filter.typesIterator())) {
            if (first) {
                buf.append(" : ");
                first=false;
            }
            else {
                buf.append('|');
            }

            buf.append(type);
        }
    }

    if (filter.countDataSchemes() > 0) {
        buf.append(" : ");
        buf.append(filter.getDataScheme(0));

        if (filter.countDataSchemes() > 1) {
            buf.append(" (other schemes)");
        }
    }

    if (filter.countDataPaths() > 0) {
        buf.append(" : ");
        buf.append(filter.getDataPath(0));

        if (filter.countDataPaths() > 1) {
            buf.append(" (other paths)");
        }
    }

    return(buf.toString());
}
 
開發者ID:if710,項目名稱:2017.2-codigo,代碼行數:54,代碼來源:PrefActivitiesActivity.java

示例5: filterEquals

import android.content.IntentFilter; //導入方法依賴的package包/類
private boolean filterEquals(IntentFilter f1, IntentFilter f2) {
	int s1 = f1.countActions();
	int s2 = f2.countActions();
	if (s1 != s2) {
		return false;
	}
	for (int i = 0; i < s1; i++) {
		if (!f2.hasAction(f1.getAction(i))) {
			return false;
		}
	}
	s1 = f1.countCategories();
	s2 = f2.countCategories();
	if (s1 != s2) {
		return false;
	}
	for (int i = 0; i < s1; i++) {
		if (!f2.hasCategory(f1.getCategory(i))) {
			return false;
		}
	}
	s1 = f1.countDataTypes();
	s2 = f2.countDataTypes();
	if (s1 != s2) {
		return false;
	}
	s1 = f1.countDataSchemes();
	s2 = f2.countDataSchemes();
	if (s1 != s2) {
		return false;
	}
	for (int i = 0; i < s1; i++) {
		if (!f2.hasDataScheme(f1.getDataScheme(i))) {
			return false;
		}
	}
	s1 = f1.countDataAuthorities();
	s2 = f2.countDataAuthorities();
	if (s1 != s2) {
		return false;
	}
	s1 = f1.countDataPaths();
	s2 = f2.countDataPaths();
	if (s1 != s2) {
		return false;
	}
	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
		s1 = f1.countDataSchemeSpecificParts();
		s2 = f2.countDataSchemeSpecificParts();
		if (s1 != s2) {
			return false;
		}
	}
	return true;
}
 
開發者ID:7763sea,項目名稱:VirtualHook,代碼行數:56,代碼來源:IntentResolver.java

示例6: filterEquals

import android.content.IntentFilter; //導入方法依賴的package包/類
private boolean filterEquals(IntentFilter f1, IntentFilter f2) {
    int s1 = f1.countActions();
    int s2 = f2.countActions();
    if (s1 != s2) {
        return false;
    }
    for (int i=0; i<s1; i++) {
        if (!f2.hasAction(f1.getAction(i))) {
            return false;
        }
    }
    s1 = f1.countCategories();
    s2 = f2.countCategories();
    if (s1 != s2) {
        return false;
    }
    for (int i=0; i<s1; i++) {
        if (!f2.hasCategory(f1.getCategory(i))) {
            return false;
        }
    }
    s1 = f1.countDataTypes();
    s2 = f2.countDataTypes();
    if (s1 != s2) {
        return false;
    }
    for (int i=0; i<s1; i++) {
        if (!f2.hasExactDataType(f1.getDataType(i))) {
            return false;
        }
    }
    s1 = f1.countDataSchemes();
    s2 = f2.countDataSchemes();
    if (s1 != s2) {
        return false;
    }
    for (int i=0; i<s1; i++) {
        if (!f2.hasDataScheme(f1.getDataScheme(i))) {
            return false;
        }
    }
    s1 = f1.countDataAuthorities();
    s2 = f2.countDataAuthorities();
    if (s1 != s2) {
        return false;
    }
    for (int i=0; i<s1; i++) {
        if (!f2.hasDataAuthority(f1.getDataAuthority(i))) {
            return false;
        }
    }
    s1 = f1.countDataPaths();
    s2 = f2.countDataPaths();
    if (s1 != s2) {
        return false;
    }
    for (int i=0; i<s1; i++) {
        if (!f2.hasDataPath(f1.getDataPath(i))) {
            return false;
        }
    }
    s1 = f1.countDataSchemeSpecificParts();
    s2 = f2.countDataSchemeSpecificParts();
    if (s1 != s2) {
        return false;
    }
    for (int i=0; i<s1; i++) {
        if (!f2.hasDataSchemeSpecificPart(f1.getDataSchemeSpecificPart(i))) {
            return false;
        }
    }
    return true;
}
 
開發者ID:TaRGroup,項目名稱:IFWManager,代碼行數:74,代碼來源:IntentResolver.java


注:本文中的android.content.IntentFilter.countDataSchemes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。