create Intent Filter - Android Intent

Android examples for Intent:Intent Filter

Description

create Intent Filter

Demo Code


//package com.java2s;

import android.content.IntentFilter;

public class Main {
    private static IntentFilter createIntentFilter(String[] intentFilters) {
        IntentFilter filter = new IntentFilter(intentFilters[0]);

        for (int i = 0; i < intentFilters.length; i++) {
            if (i == 0) {
                continue;
            }/*from  w  w w.j  a  v  a 2 s  . c o  m*/
            filter.addAction(intentFilters[i]);
        }

        return filter;
    }
}

Related Tutorials