救!如何调用处于关闭状态的第三方应用的Service(该第三方应用Service处于stop状态,应用也是关闭)
步骤1 在我的应用AA启动应用BB的L_SERVICE 【bindService方式】,结果是调用失败,bindService返回结果是false;
【其它描述:当应用BB处于启动状态(并未启动L_SERVICE)时,把应用BB切换到桌面Home;随后点击启动应用AA(或者,通过任务切换处于AA应用界面),在A的应用上重复 步骤1 的操作。结果是正常使用了BB的L_SERVICE了,bindService返回结果是true】
代码如下:
// 1.启动其它应用的Service
Intent intent = new Intent();
intent.setPackage("com.Example.BB");
intent.setAction("android.intent.action.L_SERVICE");
// 2.绑定其它应用Service
mLServiceConnection = new LServiceConnection();
mIsBinder = bindService(intent, mLServiceConnection, BIND_AUTO_CREATE);
LogUtil.d(TAG, "mIsBinder ===> " + mIsBinder);
已经反复测试几个小时了,依然是同然的结果
您的每一个用心回答,都会让这个世界变得更美好一些!