本文整理汇总了Java中android.content.ContextWrapper.unbindService方法的典型用法代码示例。如果您正苦于以下问题:Java ContextWrapper.unbindService方法的具体用法?Java ContextWrapper.unbindService怎么用?Java ContextWrapper.unbindService使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.content.ContextWrapper
的用法示例。
在下文中一共展示了ContextWrapper.unbindService方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: unbindFromService
import android.content.ContextWrapper; //导入方法依赖的package包/类
/**
* @param token The {@link ServiceToken} to unbind from
*/
public static void unbindFromService(final ServiceToken token) {
if (token == null) {
return;
}
final ContextWrapper mContextWrapper = token.mWrappedContext;
final ServiceBinder mBinder = mConnectionMap.remove(mContextWrapper);
if (mBinder == null) {
return;
}
mContextWrapper.unbindService(mBinder);
if (mConnectionMap.isEmpty()) {
mService = null;
}
}
示例2: unbindFromService
import android.content.ContextWrapper; //导入方法依赖的package包/类
/**
* @param token The {@link ServiceToken} to unbind from
*/
public static void unbindFromService(final ServiceToken token) {
if (token == null) {
return;
}
final ContextWrapper mContextWrapper = token.mWrappedContext;
final ServiceBinder mBinder = mConnectionMap.remove(mContextWrapper);
if (mBinder == null) {
return;
}
mContextWrapper.unbindService(mBinder);
if (mConnectionMap.isEmpty()) {
mService = null;
}
}
示例3: unbindFromService
import android.content.ContextWrapper; //导入方法依赖的package包/类
public static void unbindFromService(ServiceToken token) {
if (token == null) {
return;
}
ContextWrapper cw = token.mWrappedContext;
ServiceBinder sb = sConnectionMap.remove(cw);
if (sb == null) {
return;
}
cw.unbindService(sb);
if (sConnectionMap.isEmpty()) {
// presumably there is nobody interested in the service at this
// point,
// so don't hang on to the ServiceConnection
sService = null;
}
}
示例4: unbindFromService
import android.content.ContextWrapper; //导入方法依赖的package包/类
public static void unbindFromService(@Nullable final ServiceToken token) {
if (token == null) {
return;
}
final ContextWrapper mContextWrapper = token.mWrappedContext;
final ServiceBinder mBinder = mConnectionMap.remove(mContextWrapper);
if (mBinder == null) {
return;
}
mContextWrapper.unbindService(mBinder);
if (mConnectionMap.isEmpty()) {
musicService = null;
}
}
示例5: unbindFromService
import android.content.ContextWrapper; //导入方法依赖的package包/类
public static void unbindFromService(final ServiceToken token) {
if (token == null) {
return;
}
final ContextWrapper mContextWrapper = token.mWrappedContext;
final ServiceBinder mBinder = mConnectionMap.remove(mContextWrapper);
if (mBinder == null) {
return;
}
mContextWrapper.unbindService(mBinder);
if (mConnectionMap.isEmpty()) {
mService = null;
}
}
示例6: unbindFromService
import android.content.ContextWrapper; //导入方法依赖的package包/类
/**
* @param token The {@link ServiceToken} to unbind from
*/
public static void unbindFromService(final ServiceToken token) {
if (token == null) {
return;
}
final ContextWrapper mContextWrapper = token.mWrappedContext;
final ServiceBinder mBinder = mConnectionMap.remove(mContextWrapper);
if (mBinder == null) {
return;
}
mContextWrapper.unbindService(mBinder);
if (mConnectionMap.isEmpty()) {
mService = null;
}
}