通过引用bindService(Intent service, ServiceConnection conn, int flags)
我可以知道,我们什么时候应该使用 0 flags,什么时候应该使用BIND_AUTO_CREATEfor flags?该文档没有解释标志 0 的含义。
使用 0 作为示例flags
// Start auto complete service.
autoCompleteServiceIntent = new Intent(AutoCompleteService.class.getName());
startService(autoCompleteServiceIntent);
bindService(autoCompleteServiceIntent, serviceConnection, 0);
使用BIND_AUTO_CREATEas 的示例flags
mContext.bindService(new Intent("com.android.vending.billing.InAppBillingService.BIND"),
mServiceConn, Context.BIND_AUTO_CREATE);