當前位置: 首頁>>代碼示例>>Java>>正文


Java Activity.unbindService方法代碼示例

本文整理匯總了Java中android.app.Activity.unbindService方法的典型用法代碼示例。如果您正苦於以下問題:Java Activity.unbindService方法的具體用法?Java Activity.unbindService怎麽用?Java Activity.unbindService使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.app.Activity的用法示例。


在下文中一共展示了Activity.unbindService方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: unbindCustomTabsService

import android.app.Activity; //導入方法依賴的package包/類
public static void unbindCustomTabsService(Activity activity) {
    if (Build.VERSION.SDK_INT < 15 || customTabsServiceConnection == null) {
        return;
    }
    Activity currentActivity = currentCustomTabsActivity == null ? null : currentCustomTabsActivity.get();
    if (currentActivity == activity) {
        currentCustomTabsActivity.clear();
    }
    try {
        activity.unbindService(customTabsServiceConnection);
    } catch (Exception e) {
        FileLog.e("tmessages", e);
    }
    customTabsClient = null;
    customTabsSession = null;
}
 
開發者ID:MLNO,項目名稱:airgram,代碼行數:17,代碼來源:Browser.java

示例2: stopService

import android.app.Activity; //導入方法依賴的package包/類
/**
 * Bind the activity to a background service and put them into foreground
 * state.
 */
private void stopService() {
    Activity context = cordova.getActivity();

    Intent intent = new Intent(
            context, ForegroundService.class);

    if (!isBind)
        return;

    fireEvent(Event.DEACTIVATE, null);

    context.unbindService(connection);
    context.stopService(intent);

    isBind = false;
}
 
開發者ID:SUTFutureCoder,項目名稱:localcloud_fe,代碼行數:21,代碼來源:BackgroundMode.java

示例3: unbindCustomTabsService

import android.app.Activity; //導入方法依賴的package包/類
/**
 * 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;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:12,代碼來源:CustomTabActivityHelper.java

示例4: unbindCustomTabsService

import android.app.Activity; //導入方法依賴的package包/類
/**
 * 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;
}
 
開發者ID:tomoya92,項目名稱:android-apps,代碼行數:13,代碼來源:CustomTabActivityHelper.java

示例5: unbindCustomTabsService

import android.app.Activity; //導入方法依賴的package包/類
/**
 * Unbinds the Activity from the Custom Tabs Service
 *
 * @param activity the activity that is connected to the service
 */
public void unbindCustomTabsService(final Activity activity) {
    if (connection == null) {
        return;
    }
    activity.unbindService(connection);
    client = null;
    customTabsSession = null;
}
 
開發者ID:saschpe,項目名稱:android-customtabs,代碼行數:14,代碼來源:CustomTabsHelper.java


注:本文中的android.app.Activity.unbindService方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。