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


Java LIDeepLinkError类代码示例

本文整理汇总了Java中com.linkedin.platform.errors.LIDeepLinkError的典型用法代码示例。如果您正苦于以下问题:Java LIDeepLinkError类的具体用法?Java LIDeepLinkError怎么用?Java LIDeepLinkError使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: openOtherProfile

import com.linkedin.platform.errors.LIDeepLinkError; //导入依赖的package包/类
/**
 * opens a view which shows the profile of the given member
 * @param activity
 * @param memberId obtained through an api call
 * @param callback
 */
public void openOtherProfile(@NonNull Activity activity, String memberId, DeepLinkListener callback) {
    this.deepLinkListener = callback;

    LISession session = LISessionManager.getInstance(activity.getApplicationContext()).getSession();
    if (!session.isValid()) {
        callback.onDeepLinkError(new LIDeepLinkError(LIAppErrorCode.NOT_AUTHENTICATED, "there is no access token"));
        return;
    }
    try {
        if (!LIAppVersion.isLIAppCurrent(activity)) {
            AppStore.goAppStore(activity, true);
            return;
        }
        deepLinkToProfile(activity, memberId, session.getAccessToken());
    } catch (ActivityNotFoundException e) {
        callback.onDeepLinkError(new LIDeepLinkError(LIAppErrorCode.LINKEDIN_APP_NOT_FOUND,
                "LinkedIn app needs to be either installed or` updated"));
        deepLinkListener = null;
    }
}
 
开发者ID:neurospeech,项目名称:unofficial-linkedin-sdk-android,代码行数:27,代码来源:DeepLinkHelper.java

示例2: onActivityResult

import com.linkedin.platform.errors.LIDeepLinkError; //导入依赖的package包/类
/**
 * call this method in your activity's onActivityResult method.
 * Handles any response code from LinkedIn and calls the DeepLinkListener callback
 * @param activity
 * @param requestCode
 * @param resultCode
 * @param data
 */
public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {
    if (requestCode == LI_SDK_CROSSLINK_REQUEST_CODE && deepLinkListener != null) {
        if (resultCode == Activity.RESULT_OK) {
            deepLinkListener.onDeepLinkSuccess();
        } else if (resultCode == Activity.RESULT_CANCELED) {
            if (data == null || data.getExtras() == null) {
                deepLinkListener.onDeepLinkError(new LIDeepLinkError(LIAppErrorCode.USER_CANCELLED,""));
            }
            else {
                String errorMessage = data.getExtras().getString(DEEPLINK_ERROR_MESSAGE_EXTRA_NAME);
                String errorCode = data.getExtras().getString(DEEPLINK_ERROR_CODE_EXTRA_NAME);
                deepLinkListener.onDeepLinkError(new LIDeepLinkError(errorCode, errorMessage));
            }
        }
    }
}
 
开发者ID:neurospeech,项目名称:unofficial-linkedin-sdk-android,代码行数:25,代码来源:DeepLinkHelper.java

示例3: onDeepLinkError

import com.linkedin.platform.errors.LIDeepLinkError; //导入依赖的package包/类
void onDeepLinkError(LIDeepLinkError error); 
开发者ID:neurospeech,项目名称:unofficial-linkedin-sdk-android,代码行数:2,代码来源:DeepLinkListener.java


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