【确定Android中是否存在Intent Receiver】知识养成了思想,思想同时又在融化知识。这篇文章主要讲述确定Android中是否存在Intent Receiver相关的知识,希望能为你提供帮助。
- /**
- * Indicates whether the specified action can be used as an intent. This
- * method queries the package manager for installed packages that can
- * respond to an intent with the specified action. If no suitable package is
- * found, this method returns false.
- *
- * @param context The application's environment.
- * @param action The Intent action to check for availability.
- *
- * @return True if an Intent with the specified action can be sent and
- *responded to, false otherwise.
- */
- public static boolean isIntentAvailable( Context context, String action) {
- final PackageManager packageManager = context.getPackageManager( ) ;
- final Intent intent = new Intent( action) ;
- List< ResolveInfo> list =
- packageManager.queryIntentActivities( intent,
- PackageManager.MATCH_DEFAULT_ONLY) ;
- return list.size( ) > 0;
- }
推荐阅读
- 在中打开手册页预览.app
- 使用AppleScript构建和运行XCode
- Kickapps(使用jQuery&CSS在成员配置文件编辑页面中隐藏MYRSS&MYLINKS按钮)
- 终端.app符号链接命令
- 终端.app打开Apache的命令?s码httpd.conf文件文本编辑中的文件
- 通过SMTP(Gmail)在Android上发送电子邮件
- 开发Android应用程序的提示(我的经验教训)
- 构建实时,多平台移动应用程序(使用Ionic Framework和Firebase的示例)
- 微软HoloLens评论-缩小AR与VR之间的鸿沟