UploadUtils.java 文件源码

java
阅读 38 收藏 0 点赞 0 评论 0

项目:Phoenix-for-VK 作者:
/**
 * @param context  The {@link Context} to use
 * @param callback The {@link ServiceConnection} to use
 * @return The new instance of {@link ServiceToken}
 */
public static ServiceToken bindToService(final Context context, final ServiceConnection callback) {
    ContextWrapper contextWrapper = new ContextWrapper(context);
    ServiceBinder binder = new ServiceBinder(callback);
    Intent intent = new Intent().setClass(contextWrapper, UploadService.class);

    if (contextWrapper.bindService(intent, binder, 0)) {
        mConnectionMap.put(contextWrapper, binder);
        return new ServiceToken(contextWrapper);
    }

    Logger.d(TAG, "bindToService, count: " + mConnectionMap.size());
    return null;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号