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


Java AuthCancellation类代码示例

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


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

示例1: onCancel

import com.amazon.identity.auth.device.api.authorization.AuthCancellation; //导入依赖的package包/类
@Override
public void onCancel(final AuthCancellation authCancellation) {
    Toast.makeText(MainActivity.this, "Your authorization has been cancelled. Please try again.", Toast.LENGTH_SHORT).show();
}
 
开发者ID:raj10071997,项目名称:Alexa-Voice-Service,代码行数:5,代码来源:MainActivity.java

示例2: onCreate

import com.amazon.identity.auth.device.api.authorization.AuthCancellation; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);


    requestContext = RequestContext.create(this);
    requestContext.registerListener(new AuthorizeListener() {

        @Override
        public void onSuccess(AuthorizeResult authorizeResult) {
            runOnUiThread(new Runnable() {
                @Override
                public void run() {

                    setLoggingInState(true);
                }
            });
            fetchUserProfile();
        }


        @Override
        public void onError(AuthError authError) {
            Log.e(TAG, "AuthError during authorization", authError);
            runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    utilities.showToast("Error during authorization.  Please try again.", getApplicationContext());
                    resetProfileView();
                    setLoggingInState(false);
                }
            });
        }


        @Override
        public void onCancel(AuthCancellation authCancellation) {
            Log.e(TAG, "User cancelled authorization");
            runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    utilities.showToast("Authorization cancelled.", getApplicationContext());
                    resetProfileView();
                }
            });
        }
    });

    setContentView(R.layout.login_with_amazon);

    initializeUI();
}
 
开发者ID:dazcode,项目名称:smart-device-cloud,代码行数:53,代码来源:LoginWithAmazonActivity.java


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