Example usage for android.content IntentFilter SCHEME_HTTP

List of usage examples for android.content IntentFilter SCHEME_HTTP

Introduction

In this page you can find the example usage for android.content IntentFilter SCHEME_HTTP.

Prototype

String SCHEME_HTTP

To view the source code for android.content IntentFilter SCHEME_HTTP.

Click Source Link

Document

HTTP scheme.

Usage

From source file:android.content.pm.PackageParser.java

/**
 * Check if one of the IntentFilter as both actions DEFAULT / VIEW and a HTTP/HTTPS data URI
 *//*from  w  ww .j  a  va 2  s .c  o m*/
private static boolean hasDomainURLs(Package pkg) {
    if (pkg == null || pkg.activities == null)
        return false;
    final ArrayList<Activity> activities = pkg.activities;
    final int countActivities = activities.size();
    for (int n = 0; n < countActivities; n++) {
        Activity activity = activities.get(n);
        ArrayList<ActivityIntentInfo> filters = activity.intents;
        if (filters == null)
            continue;
        final int countFilters = filters.size();
        for (int m = 0; m < countFilters; m++) {
            ActivityIntentInfo aii = filters.get(m);
            if (!aii.hasAction(Intent.ACTION_VIEW))
                continue;
            if (!aii.hasAction(Intent.ACTION_DEFAULT))
                continue;
            if (aii.hasDataScheme(IntentFilter.SCHEME_HTTP) || aii.hasDataScheme(IntentFilter.SCHEME_HTTPS)) {
                return true;
            }
        }
    }
    return false;
}