本文整理汇总了Java中com.vk.sdk.VKSdk.onActivityResult方法的典型用法代码示例。如果您正苦于以下问题:Java VKSdk.onActivityResult方法的具体用法?Java VKSdk.onActivityResult怎么用?Java VKSdk.onActivityResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vk.sdk.VKSdk
的用法示例。
在下文中一共展示了VKSdk.onActivityResult方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onActivityResult
import com.vk.sdk.VKSdk; //导入方法依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
mTwitterAuthClient.onActivityResult(requestCode, resultCode, data);
if (!VKSdk.onActivityResult(requestCode, resultCode, data, new VKCallback<VKAccessToken>() {
@Override
public void onResult(VKAccessToken token) {
initUIAfterLogin();
}
@Override
public void onError(VKError error) {
}
})) {
super.onActivityResult(requestCode, resultCode, data);
} else {
super.onActivityResult(requestCode, resultCode, data);
}
}
示例2: onActivityResult
import com.vk.sdk.VKSdk; //导入方法依赖的package包/类
@Override
public void onActivityResult( int requestCode, int resultCode, Intent data ) {
if( !VKSdk.onActivityResult( requestCode, resultCode, data, new VKCallback<VKAccessToken>() {
@Override
public void onResult( VKAccessToken res ) {
AIR.log( "AuthFunction::onActivityResult | VK_AUTH_SUCCESS" );
AIR.dispatchEvent( AIRVKEvent.VK_AUTH_SUCCESS, VKAccessTokenUtils.toJSON( res ) );
}
@Override
public void onError( VKError error ) {
AIR.log( "AuthFunction::onActivityResult | VK_AUTH_ERROR: " + error.errorMessage + " reason: " + error.errorReason );
AIR.dispatchEvent( AIRVKEvent.VK_AUTH_ERROR, (error.errorMessage == null) ? "Error - user denied access." : error.errorMessage );
}
} ) ) {
AIR.log( "AuthFunction::onActivityResult | no callback" );
}
AndroidActivityWrapper.GetAndroidActivityWrapper().removeActivityResultListener( this );
}
示例3: onActivityResult
import com.vk.sdk.VKSdk; //导入方法依赖的package包/类
@Override
protected void onActivityResult(final int requestCode, int resultCode, Intent data) {
if (!VKSdk.onActivityResult(requestCode, resultCode, data, new VKCallback<VKAccessToken>() {
@Override
public void onResult(final VKAccessToken accessToken) {
createUserComponentAndLaunchMainActivity();
}
@Override
public void onError(VKError error) {
new AlertDialog.Builder(LoginActivity.this)
.setMessage("Login failed: " + error.errorReason)
.setPositiveButton(android.R.string.ok, null)
.show();
}
})) {
super.onActivityResult(requestCode, resultCode, data);
}
}
示例4: onActivityResult
import com.vk.sdk.VKSdk; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (!VKSdk.onActivityResult(requestCode, resultCode, data, new VKCallback<VKAccessToken>() {
@Override
public void onResult(VKAccessToken res) {
Log.i(LOG_TAG, "VKAccessToken: " + res);
// User passed Authorization
loadUser("onActivityResult");
}
@Override
public void onError(VKError error) {
// User didn't pass Authorization
Log.e(LOG_TAG, "onActivityResult.onError: " + error);
}
})) {
super.onActivityResult(requestCode, resultCode, data);
}
}
示例5: onActivityResult
import com.vk.sdk.VKSdk; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
VKCallback<VKAccessToken> callback = new VKCallback<VKAccessToken>() {
@Override
public void onResult(VKAccessToken res) {
// User passed Authorization
startTestActivity();
}
@Override
public void onError(VKError error) {
// User didn't pass Authorization
}
};
if (!VKSdk.onActivityResult(requestCode, resultCode, data, callback)) {
super.onActivityResult(requestCode, resultCode, data);
}
}
示例6: onActivityResult
import com.vk.sdk.VKSdk; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
VKSdk.onActivityResult(requestCode, resultCode, data, this);
}
示例7: onActivityResult
import com.vk.sdk.VKSdk; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (!VKSdk.onActivityResult(requestCode, resultCode, data, this)) {
super.onActivityResult(requestCode, resultCode, data);
}
}