【已解决】 支付宝例子,第三方软件无法绑定支付宝的服务?
我需要先启动支付宝app,在启动第三方app,反之mIsBind为false.

private void bindAliPayService() {
Log.d(TAG, "开始绑定服务");
Intent intent = new Intent();
intent.setAction("com.example.myapplication.function.aliplay.THIRD_PART_PAY");
intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.setPackage("com.example.myapplication");
startService(intent);
aliPayConnection = new AliPayConnection();
mIsBind = bindService(intent, aliPayConnection, BIND_AUTO_CREATE);
Log.d(TAG, "服务绑定完成" + mIsBind);
}
那你另外一边的log呢?
返回false的原因有这些呀:
if the system couldn't find the service or if your client doesn't have permission to bind to it
第一个是你系统找不到你指定的服务,第二种是没有权限。