参考:

http://blog.csdn.net/qs_csu/article/details/45114251

我做阿里云账号登录的时候,遇到一个问题,不知道阿里云服务的包名。怎么办?第二种方法可以查,查询之后,自己手动设置setPackage 就可以了。

public static Intent getExplicitIntent(Context context, Intent implicitIntent) {
// Retrieve all services that can match the given intent
PackageManager pm = context.getPackageManager();
List<ResolveInfo> resolveInfo = pm.queryIntentServices(implicitIntent, 0);
// Make sure only one match was found
if (resolveInfo == null || resolveInfo.size() != 1) {
return null;
}
// Get component info and create ComponentName
ResolveInfo serviceInfo = resolveInfo.get(0);
String packageName = serviceInfo.serviceInfo.packageName;
String className = serviceInfo.serviceInfo.name;
ComponentName component = new ComponentName(packageName, className);
// Create a new intent. Use the old one for extras and such reuse
Intent explicitIntent = new Intent(implicitIntent);
// Set the component to be explicit
explicitIntent.setComponent(component);
return explicitIntent;
}

可以查询手机上面的每一个action对应的Intent。哈哈,好强。

Service Intent must be explicit的更多相关文章

  1. Android Service Intent must be explicit的解决方法

    今天在学习Android的Service组件的时候,在AndroidMainfest.xml中定义了 <service android:name=".BindService" ...

  2. [Android分享] 如何解决Android 5.0中出现的警告:Service Intent must be explicit

    Android 5.0程序运行报Service Intent must be explicit错误,原因是5.0的service必须显式调用 改成 Intent intent = new Intent ...

  3. 【转】Service Intent must be explicit的解决方法

    原文网址:http://blog.csdn.net/shenzhonglaoxu/article/details/42675287 今天在学习android的Service组件的时候,在Android ...

  4. 如何解决Android 5.0中出现的警告:Service Intent must be explicit

    有些时候我们使用Service的时需要采用隐私启动的方式,但是Android 5.0一出来后,其中有个特性就是Service Intent  must be explitict,也就是说从Lollip ...

  5. java.lang.IllegalArgumentException: Service Intent must be explicit 解决办法

    java.lang.IllegalArgumentException: Service Intent must be explicit 意思是服务必须得显式的调用 我之前是这样使用绑定Service的 ...

  6. 解决Android 5.0中出现的警告:Service Intent must be explicit

    extends:http://www.eoeandroid.com/thread-568853-1-1.html 本帖最后由 469874851 于 2015-3-11 18:15 编辑 有些时候我们 ...

  7. Service Intent must be explicit的解决方法

    今天遇到如标题问题,查阅资料:http://blog.android-develop.com/2014/10/android-l-api-21-javalangillegalargumen.html ...

  8. 我的Android进阶之旅------>如何解决Android 5.0中出现的警告: Service Intent must be explicit:

    我的Android进阶之旅-->如何解决Android 5.0中出现的警告: java.lang.IllegalArgumentException: Service Intent must be ...

  9. 我的Android进阶之旅------&gt;怎样解决Android 5.0中出现的警告: Service Intent must be explicit:

    我的Android进阶之旅-->怎样解决Android 5.0中出现的警告: java.lang.IllegalArgumentException: Service Intent must be ...

  10. AIDL使用绑定启动远程Service出现Service Intent must be explicit: Intent

    Intent intent = new Intent(); intent.setAction("remote.MyRemoteService.Action"); 使用AIDL调用远 ...

随机推荐

  1. Linux目录与文件的权限意义

    ls -l和ls -al的区别:第一个不会显示隐藏文件,第二个会显示隐藏文件(以点(.)开头的文件) 一.权限对文件(r.w.x主要针对文件的内容而言)的重要性 r:可读取文件内容 w:可以编辑.新增 ...

  2. vos对接时业务确认及信息安全责任承诺书

           业务确认及信息安全责任承诺书 双方达成一致,******网络科技有限公司向            有限公司提供中国移动网内语音线路接入服务,保证资源长期使用,保证线路资源接通率标 准,合 ...

  3. Node.js-npm安装包目录修改

    请借我一个哭的表情....=.= 等我发现的时候为时已晚~所有安装的包都去了C盘,而强迫症的我想卸载了之前所有的包再重新下一遍!!! 切记!安装好npm后,记得修改: 原始路径: 修改后的路径(如果没 ...

  4. Apache2.4 authz_core_module模块使用

    Description: Core Authorization Status: Base Moduledentifier: authz_core_module Sourceile: mod_authz ...

  5. 问题 A: E2 驾驭const

    题目描述 引入了const关键词,用于指定“常”对象及“常”对象成员,提供了对数据的一种保护机制,这C++语言的特色之一.但由此,也引出了一些语法上的要求.这些语法要求,实际上有一套完善的原则,需要熟 ...

  6. EF 连接数据库 Mysql (database first ) 一个表对应一个模型

    准备工作 1.下载vs2015 2.下载mysql2017 3.安装 1.创建数据库 2. 将数据库映射成模型 3创建aspx 文件. 写下窗体内容的代码 hello_worldEntities en ...

  7. jquery控制display属性为none或block

    代码如下: //隐藏 $("#id").css('display','none'); //显示 $("#id").css('display','block'); ...

  8. java重定向与请求转发

    重定向是不能直接访问WEB-INF下的资源的,因为重定向是浏览器二次请求,众所周知,客户端是不能直接访问WEB-INF下的资源的. 而请求转发却可以直接访问. 然而重定向却可以间接访问WEN-INF下 ...

  9. MyBatis的优缺点以及特点

    特点: mybatis是一种持久层框架,也属于ORM映射.前身是ibatis. 相比于hibernatehibernate为全自动化,配置文件书写之后不需要书写sql语句,但是欠缺灵活,很多时候需要优 ...

  10. Git永久删除commit--[非教程]

    假设当前分支为master,当前的commit情况如下,现在需要删除commit_id_2和commit_id_4: commit_id_1 commit_id_2 commit_id_3 commi ...