本文整理汇总了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;
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}