当前位置: 首页>>代码示例>>Java>>正文


Java Service.onDestroy方法代码示例

本文整理汇总了Java中android.app.Service.onDestroy方法的典型用法代码示例。如果您正苦于以下问题:Java Service.onDestroy方法的具体用法?Java Service.onDestroy怎么用?Java Service.onDestroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.app.Service的用法示例。


在下文中一共展示了Service.onDestroy方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: unbindService

import android.app.Service; //导入方法依赖的package包/类
@Override
public boolean unbindService(IServiceConnection conn) throws RemoteException {
    Log.e("BaseDelegateService","unbindService");
    Iterator iter = mActivateServices.entrySet().iterator();
    AdditionalServiceRecord record = null;
    while (iter.hasNext()) {
        Map.Entry<AdditionalServiceRecord,Service> entry = (Map.Entry<AdditionalServiceRecord,Service>) iter.next();
        AdditionalServiceRecord tmpRecord = entry.getKey();
        if(tmpRecord.activeConnections.contains(conn)){
            //service has created
            record = tmpRecord;
            break;
        }
    }
    if(record!=null){
        record.activeConnections.remove(conn);
        if(record.activeConnections.size()==0){
            if(!record.calledStart || (record.calledStart && record.delayStop)){
                //service can stop
                Service service = mActivateServices.remove(record);
                service.onDestroy();
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:28,代码来源:BaseDelegateService.java

示例2: handleOnDestroyOne

import android.app.Service; //导入方法依赖的package包/类
private void handleOnDestroyOne(ServiceInfo targetInfo) {
    Service service = (Service) this.mNameService.get(targetInfo.name);
    if (service != null) {
        service.onDestroy();
        this.mNameService.remove(targetInfo.name);
        Object token = findTokenByService(service);
        this.mTokenServices.remove(token);
        this.mServiceTaskIds.remove(token);
        QueuedWorkCompat.waitToFinish();
        ApkManager.getInstance().onServiceDestory(null, targetInfo);
    }
    QueuedWorkCompat.waitToFinish();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:14,代码来源:ServcesManager.java

示例3: onDestroy

import android.app.Service; //导入方法依赖的package包/类
public void onDestroy() {
    for (Service service : this.mTokenServices.values()) {
        service.onDestroy();
    }
    this.mTokenServices.clear();
    this.mServiceTaskIds.clear();
    this.mNameService.clear();
    QueuedWorkCompat.waitToFinish();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:10,代码来源:ServcesManager.java

示例4: handleOnDestroyOne

import android.app.Service; //导入方法依赖的package包/类
private void handleOnDestroyOne(ServiceInfo targetInfo) {
    Service service = mNameService.get(targetInfo.name);
    if (service != null) {
        service.onDestroy();
        mNameService.remove(targetInfo.name);
        Object token = findTokenByService(service);
        mTokenServices.remove(token);
        mServiceTaskIds.remove(token);
        service = null;
        QueuedWorkCompat.waitToFinish();
        PluginManager.getInstance().onServiceDestory(null, targetInfo);
    }
    QueuedWorkCompat.waitToFinish();
}
 
开发者ID:amikey,项目名称:DroidPlugin,代码行数:15,代码来源:ServcesManager.java

示例5: onDestroy

import android.app.Service; //导入方法依赖的package包/类
public void onDestroy() {
    for (Service service : mTokenServices.values()) {
        service.onDestroy();
    }
    mTokenServices.clear();
    mServiceTaskIds.clear();
    mNameService.clear();
    QueuedWorkCompat.waitToFinish();
}
 
开发者ID:amikey,项目名称:DroidPlugin,代码行数:10,代码来源:ServcesManager.java


注:本文中的android.app.Service.onDestroy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。