判断安卓Intent或Action在系统中是否能被启动
来源:互联网 发布:怎样提高seo排名 编辑:程序博客网 时间:2024/04/29 07:45
判断安卓应用Intent或Action在系统中是否能被启动
/*** @param context The application's environment.* @param intent The Intent 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, Intent intent) {if((null == context) || (null == intent))return false;final PackageManager packageManager = context.getPackageManager();List<ResolveInfo> list = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); if(null == list)return false;return list.size() > 0;}还可以将参数intent替换为action,在函数内new一个Intent再进行判断。
0 0
- 判断安卓Intent或Action在系统中是否能被启动
- 安卓intent action系统服务
- 安卓Intent中action整理收集
- 安卓判断是否第一次启动程序
- 安卓 判断当前应用是否启动
- 判断某Activity是否在系统中存在?是否启动过?以及让它自行关闭
- 安卓intent发起广播事件给系统或当前app,并从系统或当前app中接收广播
- 判断一个数是否能被17或35整除
- 判断一个整数是否能被3或5整除
- 安卓开发中判断是否联网
- 安卓应用中判断手机是否连接网络或者是否连接wife或手机3/4G
- (4.2.16.3)判断某Activity是否在系统中存在?是否启动过?以及让它自行关闭
- 判断安卓应用是否是第一次启动
- 通过 UserAgent 判断是否在我们自己的安卓APP中
- 判断是否有适当的应用能打开intent
- 安卓开发工具类-判断系统服务是否开启
- Intent中常用的系统Action
- 工具类 安卓 判断设备是否提供该Intent功能
- mysql处理百万级以上的数据时提高其查询速度的方法
- C# 相对路径
- Oracle建立DBLINK的详细步骤记录
- 指针编程艺术
- 128_leetcode_Sort Colors
- 判断安卓Intent或Action在系统中是否能被启动
- 字典树/trie树,基数树/radix树
- PHP判断字符串编码是否utf8并转换的方法
- [PAT]1001. A+B Format (20)
- 百度员工离职总结:如何做个好员工?
- ie6不识别png图片的解决方案
- sql存储过程
- 在Windows操作系统中,如何终止占有的8080端口的tomcat进程
- POJ 1276 Cash Machine