本文整理匯總了Java中android.content.IntentFilter.addDataPath方法的典型用法代碼示例。如果您正苦於以下問題:Java IntentFilter.addDataPath方法的具體用法?Java IntentFilter.addDataPath怎麽用?Java IntentFilter.addDataPath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.content.IntentFilter
的用法示例。
在下文中一共展示了IntentFilter.addDataPath方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getInstallIntentFilter
import android.content.IntentFilter; //導入方法依賴的package包/類
/**
* Gets an {@link IntentFilter} for matching events from the install
* process based on the original download URL as a {@link Uri}.
*/
public static IntentFilter getInstallIntentFilter(Uri uri) {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(Installer.ACTION_INSTALL_STARTED);
intentFilter.addAction(Installer.ACTION_INSTALL_COMPLETE);
intentFilter.addAction(Installer.ACTION_INSTALL_INTERRUPTED);
intentFilter.addAction(Installer.ACTION_INSTALL_USER_INTERACTION);
intentFilter.addDataScheme(uri.getScheme());
intentFilter.addDataAuthority(uri.getHost(), String.valueOf(uri.getPort()));
intentFilter.addDataPath(uri.getPath(), PatternMatcher.PATTERN_LITERAL);
return intentFilter;
}
示例2: getUninstallIntentFilter
import android.content.IntentFilter; //導入方法依賴的package包/類
public static IntentFilter getUninstallIntentFilter(String packageName) {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(Installer.ACTION_UNINSTALL_STARTED);
intentFilter.addAction(Installer.ACTION_UNINSTALL_COMPLETE);
intentFilter.addAction(Installer.ACTION_UNINSTALL_INTERRUPTED);
intentFilter.addAction(Installer.ACTION_UNINSTALL_USER_INTERACTION);
intentFilter.addDataScheme("package");
intentFilter.addDataPath(packageName, PatternMatcher.PATTERN_LITERAL);
return intentFilter;
}
示例3: getIntentFilter
import android.content.IntentFilter; //導入方法依賴的package包/類
/**
* Get a prepared {@link IntentFilter} for use for matching this service's action events.
*
* @param urlString The full file URL to match.
*/
public static IntentFilter getIntentFilter(String urlString) {
Uri uri = Uri.parse(urlString);
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(Downloader.ACTION_STARTED);
intentFilter.addAction(Downloader.ACTION_PROGRESS);
intentFilter.addAction(Downloader.ACTION_COMPLETE);
intentFilter.addAction(Downloader.ACTION_INTERRUPTED);
intentFilter.addAction(Downloader.ACTION_CONNECTION_FAILED);
intentFilter.addDataScheme(uri.getScheme());
intentFilter.addDataAuthority(uri.getHost(), String.valueOf(uri.getPort()));
intentFilter.addDataPath(uri.getPath(), PatternMatcher.PATTERN_LITERAL);
return intentFilter;
}
示例4: getCompletionFilter
import android.content.IntentFilter; //導入方法依賴的package包/類
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;
}