android.app.Activity.unbindService()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(156)

本文整理了Java中android.app.Activity.unbindService()方法的一些代码示例,展示了Activity.unbindService()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Activity.unbindService()方法的具体详情如下:
包路径:android.app.Activity
类名称:Activity
方法名:unbindService

Activity.unbindService介绍

暂无

代码示例

代码示例来源:origin: nickbutcher/plaid

/**
 * Unbinds the Activity from the Custom Tabs Service
 * @param activity the activity that is bound to the service
 */
public void unbindCustomTabsService(Activity activity) {
  if (mConnection == null) return;
  activity.unbindService(mConnection);
  mClient = null;
  mCustomTabsSession = null;
}

代码示例来源:origin: ankidroid/Anki-Android

/**
 * Unbinds the Activity from the Custom Tabs Service.
 * @param activity the activity that is connected to the service.
 */
public void unbindCustomTabsService(Activity activity) {
  if (mConnection == null) return;
  activity.unbindService(mConnection);
  mClient = null;
  mCustomTabsSession = null;
  mConnection = null;
}

代码示例来源:origin: hidroh/materialistic

/**
 * Unbinds the Activity from the Custom Tabs Service.
 * @param activity the activity that is connected to the service.
 */
void unbindCustomTabsService(Activity activity) {
  if (mConnection == null) {
    return;
  }
  activity.unbindService(mConnection);
  mClient = null;
  mCustomTabsSession = null;
  mConnection = null;
}

代码示例来源:origin: guardianproject/haven

public void destroy ()
{
  if (mConnection != null) {
    this.context.unbindService(mConnection);
    mConnection = null;
  }
  stopCamera();
}

代码示例来源:origin: schwabe/ics-openvpn

private void unbindService() {
  getActivity().unbindService(mConnection);
}

代码示例来源:origin: willowtreeapps/Hyperion-Android

@Override
  public void onActivityPaused(Activity activity) {
    if (foregroundActivity == activity) {
      final ServiceConnection connection = container.getComponent(activity).getServiceConnection();
      foregroundActivity.unbindService(connection);
      foregroundActivity = null;
    }
  }
}

代码示例来源:origin: DreaminginCodeZH/CustomTabsHelper

/**
 * Unbinds the Activity from the Custom Tabs Service.
 * @param activity the activity that is connected to the service.
 */
public void unbindCustomTabsService(Activity activity) {
  if (mConnection == null) return;
  activity.unbindService(mConnection);
  mClient = null;
  mCustomTabsSession = null;
  mConnection = null;
}

代码示例来源:origin: li2/learning-android-open-source

void destroy() {
  if (mServiceBound) {
    mActivity.unbindService(mConnection);
  }
}

代码示例来源:origin: geniusgithub/AndroidDialer

@Override
public void unbindService(ServiceConnection conn) {
  mProcessOngoing = false;
  super.unbindService(conn);
}

代码示例来源:origin: NianguoWang/ZhihuReader-master

/**
 * Unbinds the Activity from the Custom Tabs Service.
 * @param activity the activity that is connected to the service.
 */
public void unbindCustomTabsService(Activity activity) {
  if (mConnection == null) return;
  activity.unbindService(mConnection);
  mClient = null;
  mCustomTabsSession = null;
  mConnection = null;
}

代码示例来源:origin: qiubiteme/android_api_demos

void destroy() {
  if (mServiceBound) {
    mActivity.unbindService(mConnection);
  }
}

代码示例来源:origin: Wensibob/GankClient

/**
 * Unbinds the Activity from the Custom Tabs Service.
 * @param activity the activity that is connected to the service.
 */
public void unbindCustomTabsService(Activity activity) {
  if (mConnection == null) return;
  activity.unbindService(mConnection);
  mClient = null;
  mCustomTabsSession = null;
  mConnection = null;
}

代码示例来源:origin: bkhezry/ExtraWebView

/**
 * Unbinds the Activity from the Custom Tabs Service.
 * @param activity the activity that is connected to the service.
 */
public void unbindCustomTabsService(Activity activity) {
  if (mConnection == null) {
    return;
  }
  activity.unbindService(mConnection);
  mClient = null;
  mCustomTabsSession = null;
  mConnection = null;
}

代码示例来源:origin: fasteque/rgb-tool

/**
 * Unbinds the Activity from the Custom Tabs Service
 *
 * @param activity the activity that is connected to the service
 */
public void unbindCustomTabsService(Activity activity) {
  if (connection == null) {
    return;
  }
  activity.unbindService(connection);
  client = null;
  customTabsSession = null;
}

代码示例来源:origin: hymanme/MaterialHome

/**
 * Unbinds the Activity from the Custom Tabs Service
 *
 * @param activity the activity that is bound to the service
 */
public void unbindCustomTabsService(Activity activity) {
  if (mConnection == null) return;
  activity.unbindService(mConnection);
  mClient = null;
  mCustomTabsSession = null;
}

代码示例来源:origin: com.uphyca/android-junit4-robolectric

/**
 * @param conn
 * @see android.content.ContextWrapper#unbindService(android.content.ServiceConnection)
 */
public void unbindService(ServiceConnection conn) {
  mActivity.unbindService(conn);
}

代码示例来源:origin: thuetz/Energize

private void doUnbindService() {
  if (this.monitorService != null) {
    try {
      final Message msg = Message.obtain(null, MonitorBatteryStateService.MSG_UNREGISTER_CLIENT);
      msg.replyTo = this.monitorServiceMessanger;
      this.monitorService.send(msg);
    } catch (final RemoteException ignored) {
    }
  }
  this.getActivity().unbindService(this.monitorServiceConnection);
  this.monitorService = null;
}

代码示例来源:origin: thuetz/Energize

private void doUnbindService() {
  if (this.monitorService != null) {
    try {
      final Message msg = Message.obtain(null, MonitorBatteryStateService.MSG_UNREGISTER_CLIENT);
      msg.replyTo = this.monitorServiceMessanger;
      this.monitorService.send(msg);
    } catch (final RemoteException e) {
    }
  }
  this.getActivity().unbindService(this.monitorServiceConnection);
  this.monitorService = null;
}

代码示例来源:origin: trishika/DroidUPnP

@Override
public void pause()
{
  super.pause();
  activity.unbindService(upnpServiceListener.getServiceConnexion());
  activity = null;
}

代码示例来源:origin: fire3/sailorcast

@Override
public void pause()
{
  super.pause();
  activity.unbindService(upnpServiceListener.getServiceConnexion());
  activity = null;
}

相关文章

Activity类方法