本文整理汇总了Java中com.vk.sdk.VKSdk.authorize方法的典型用法代码示例。如果您正苦于以下问题:Java VKSdk.authorize方法的具体用法?Java VKSdk.authorize怎么用?Java VKSdk.authorize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vk.sdk.VKSdk
的用法示例。
在下文中一共展示了VKSdk.authorize方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shareVK
import com.vk.sdk.VKSdk; //导入方法依赖的package包/类
private void shareVK() {
if (VKSdk.isLoggedIn() || VKSdk.wakeUpSession()) {
new VKShareDialog()
.setText(getString(R.string.like_text))
.setAttachmentLink(getString(R.string.like_url_title), getString(R.string.like_url))
.setShareDialogListener(new VKShareDialog.VKShareDialogListener() {
@Override
public void onVkShareComplete(int i) {
showThankYouToast();
((NavigationActivity)getActivity()).getTracker(NavigationActivity.TrackerName.APP_TRACKER)
.send(new HitBuilders.EventBuilder().setCategory("Sharing").setAction("VK").setLabel("OK").build());
}
@Override
public void onVkShareCancel() {
((NavigationActivity)getActivity()).getTracker(NavigationActivity.TrackerName.APP_TRACKER)
.send(new HitBuilders.EventBuilder().setCategory("Sharing").setAction("VK").setLabel("Cancel").build());
}
})
.show(getFragmentManager(), "SHARE");
} else
VKSdk.authorize(NavigationActivity.vkScope, true, false);
}
示例2: onResume
import com.vk.sdk.VKSdk; //导入方法依赖的package包/类
@Override
public void onResume() {
super.onResume();
if (VKSdk.isLoggedIn() || VKSdk.wakeUpSession())
update(isNeedUpdate());
else
VKSdk.authorize(NavigationActivity.vkScope, true, false);
}
示例3: loginIfNeeded
import com.vk.sdk.VKSdk; //导入方法依赖的package包/类
private boolean loginIfNeeded() {
boolean isLoggedIn = VKSdk.isLoggedIn();
Log.d(TAG, "initVK is loggedIn ? " + isLoggedIn);
if (!isLoggedIn)
VKSdk.authorize(VK_PERMISSIONS_SCOPE);
return isLoggedIn;
}
示例4: auth
import com.vk.sdk.VKSdk; //导入方法依赖的package包/类
public static void auth(){
VKSdk.authorize(Config.SCOPE_LIST);
}
示例5: onTokenExpired
import com.vk.sdk.VKSdk; //导入方法依赖的package包/类
@Override
public void onTokenExpired(VKAccessToken expiredToken) {
VKSdk.authorize(sVkScope, true, false);
}
示例6: onTokenExpired
import com.vk.sdk.VKSdk; //导入方法依赖的package包/类
@Override
public void onTokenExpired(VKAccessToken expiredToken) {
VKSdk.authorize(VK_PERMISSIONS_SCOPE);
}