本文整理汇总了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;
}
}
示例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));
}
}
}
}
示例3: onDeepLinkError
import com.linkedin.platform.errors.LIDeepLinkError; //导入依赖的package包/类
void onDeepLinkError(LIDeepLinkError error);