onUnbind ( )源码实例Demo

android.app.Service#onUnbind ( )源码实例Demo

下面列出了android.app.Service#onUnbind ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: letv   文件: ServcesManager.java
private boolean handleOnUnbindOne(Intent intent) throws Exception {
    ServiceInfo info = ApkManager.getInstance().resolveServiceInfo(intent, 0);
    if (info == null) {
        return false;
    }
    Service service = (Service) this.mNameService.get(info.name);
    if (service == null) {
        return false;
    }
    intent.setExtrasClassLoader(getClassLoader(info.applicationInfo));
    return service.onUnbind(intent);
}
 
源代码2 项目: DroidPlugin   文件: ServcesManager.java
private boolean handleOnUnbindOne(Intent intent) throws Exception {
    ServiceInfo info = PluginManager.getInstance().resolveServiceInfo(intent, 0);
    if (info != null) {
        Service service = mNameService.get(info.name);
        if (service != null) {
            ClassLoader classLoader = getClassLoader(info.applicationInfo);
            intent.setExtrasClassLoader(classLoader);
            return service.onUnbind(intent);
        }
    }
    return false;
}
 
源代码3 项目: deagle   文件: LocalAidlServices.java
private static void unbindService(final Service service, final Intent intent) {
	if (service instanceof AidlService)
		((AidlService) service).closeBinder();
	else try {
		final boolean rebind = service.onUnbind(intent);	// TODO: Support rebind if true is returned.
		if (rebind) throw new UnsupportedOperationException("Sorry, onRebind() is not yet supported.");
	} catch (final RuntimeException e) {
		Log.e(TAG, "Error unbinding " + service, e);
	}
}