intentFilter.addDataPath(path, PatternMatcher.PATTERN_LITERAL); intentFilter.addDataPath(pathPrefix, PatternMatcher.PATTERN_PREFIX); intentFilter.addDataPath(pathPattern, PatternMatcher.PATTERN_SIMPLE_GLOB);
PatternMatcher p = pIt.next(); if (p.match(path)) { filter.addDataPath(p.getPath(), p.getType()); break;
public static IntentFilter getCompletionFilter(String taskName) { IntentFilter filter = new IntentFilter(TaskerIntent.ACTION_TASK_COMPLETE); filter.addDataScheme(TASK_NAME_DATA_SCHEME); filter.addDataPath(taskName, PatternMatcher.PATTERN_LITERAL); return filter; }
public static IntentFilter getCompletionFilter(String taskName) { IntentFilter filter = new IntentFilter(TaskerIntent.ACTION_TASK_COMPLETE); filter.addDataScheme(TASK_NAME_DATA_SCHEME); filter.addDataPath(taskName, PatternMatcher.PATTERN_LITERAL); return filter; }
IntentFilter ndef = new IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED); ndef.addDataScheme("vnd.android.nfc"); ndef.addDataAuthority("ext", null); ndef.addDataPath("/com.example:mytype", PatternMatcher.PATTERN_PREFIX); IntentFilter[] intentFiltersArray = new IntentFilter[] { ndef, };
IntentFilter ndef = new IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED); ndef.addDataScheme("vnd.android.nfc"); ndef.addDataAuthority("ext", null); ndef.addDataPath("/com.example:sometype", PatternMatcher.PATTERN_PREFIX);
IntentFilter ifilter = new IntentFilter("com.your.package.ACTION_TWITTER_MSG"); ifilter.addDataScheme("twitter"); ifilter.addDataAuthority("com.your.package", null); ifilter.addDataPath("/foo", PatternMatcher.PATTERN_PREFIX);
IntentFilter ndef = new IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED); ndef.addDataScheme("http"); ndef.addDataAuthority("somehost.example.com", null); ndef.addDataPath("/somepath", PatternMatcher.PATTERN_PREFIX);
private NfcAdapter nfcAdapter; private PendingIntent mPendingIntent; private IntentFilter[] mFilters; private String[][] mTechLists; protected void onCreate(Bundle savedInstanceState) nfcAdapter = NfcAdapter.getDefaultAdapter(this); mPendingIntent = PendingIntent.getActivity(this, 0, new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0); IntentFilter ndefPkg = new IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED); try { ndefPkg.addDataScheme("vnd.android.nfc"); ndefPkg.addDataAuthority("ext", null); ndefPkg.addDataPath("/android.com:pkg", 0); } catch (Exception e) { e.printStackTrace(); } mFilters = new IntentFilter[] {ndefPkg; mTechLists = new String[][] { new String[] { NfcF.class.getName() } }; } protected void onResume() { super.onResume(); nfcAdapter.enableForegroundDispatch(this, mPendingIntent, mFilters, mTechLists); } protected void onPause() { super.onPause(); nfcAdapter.disableForegroundDispatch(this); }
filter.addDataScheme(getBaseContext().getString(R.string.uri_scheme)); filter.addDataAuthority(getBaseContext().getString(R.string.uri_authority), null); filter.addDataPath(getBaseContext().getString(R.string.uri_path), PatternMatcher.PATTERN_LITERAL); registerReceiver(receiver, filter);
intentFilter.addDataPath(str, PatternMatcher.PATTERN_LITERAL); intentFilter.addDataPath(str, PatternMatcher.PATTERN_PREFIX); intentFilter.addDataPath(str, PatternMatcher.PATTERN_SIMPLE_GLOB);
intentFilter.addDataPath(path, PatternMatcher.PATTERN_LITERAL); intentFilter.addDataPath(pathPattern, PatternMatcher.PATTERN_SIMPLE_GLOB); intentFilter.addDataPath(pathPrefix, PatternMatcher.PATTERN_PREFIX);
curFilter.addDataPath(bean.path, bean.getPatternMatcherType());
PatternMatcher p = pIt.next(); if (p.match(path)) { filter.addDataPath(p.getPath(), p.getType()); break;
PatternMatcher p = pIt.next(); if (p.match(path)) { filter.addDataPath(p.getPath(), p.getType()); break;