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


Java FirebaseAuth.signOut方法代码示例

本文整理汇总了Java中com.google.firebase.auth.FirebaseAuth.signOut方法的典型用法代码示例。如果您正苦于以下问题:Java FirebaseAuth.signOut方法的具体用法?Java FirebaseAuth.signOut怎么用?Java FirebaseAuth.signOut使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.firebase.auth.FirebaseAuth的用法示例。


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

示例1: onComplete

import com.google.firebase.auth.FirebaseAuth; //导入方法依赖的package包/类
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
    if (task.isSuccessful()) {
        FirebaseAuth firebaseAuth = SessionManager.getFirebaseAuth();
        FirebaseUser currentUser = SessionManager.getFirebaseUser();

        boolean isEmailVerified = currentUser.isEmailVerified();
        // TODO zmienić z powrotem
        if (true) {
            updateLoginConfigInSharedPrefs();

            SessionManager.initializeCurrentUserFirebaseListeners();
            SessionManager.initializeFamilyMembersFirebaseListener();

            Intent intent = new Intent(context, MainActivity.class);
            context.startActivity(intent);
        } else {
            firebaseAuth.signOut();
            Toast.makeText(context, R.string.email_not_verified, Toast.LENGTH_LONG).show();
        }
    } else {
        logger.logWarn("Sign In Failure: " + task.getException());
        Toast.makeText(context, R.string.invalid_email_or_password, Toast.LENGTH_LONG).show();
    }
}
 
开发者ID:lmnpWmi,项目名称:wirtualnaApteczka,代码行数:26,代码来源:LogInOnCompleteListener.java

示例2: onNavigationItemSelected

import com.google.firebase.auth.FirebaseAuth; //导入方法依赖的package包/类
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
    int id = item.getItemId();

    if(id == R.id.nav_signOut) {
        PreferenceUtil.signOut(this);
        FirebaseAuth mAuth = FirebaseAuth.getInstance();
        if(mAuth.getCurrentUser() != null) {
            mAuth.signOut();
        }
        startActivity(new Intent(this, LoginActivity.class));
        finish();
    }
    DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
    drawer.closeDrawer(GravityCompat.START);
    return true;
}
 
开发者ID:mangoblogger,项目名称:MangoBloggerAndroidApp,代码行数:18,代码来源:HomeActivity.java

示例3: onOptionsItemSelected

import com.google.firebase.auth.FirebaseAuth; //导入方法依赖的package包/类
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch(item.getItemId()) {
        case android.R.id.home:
            finish();
            break;
        case R.id.changePasswordItem:
            new AlertDialog.Builder(this)
                .setTitle(R.string.change_password_button)
                .setMessage(R.string.edit_password_dialog_contet)
                .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        String email = CheckLoginActivity.user.getEmail();
                        emailSent(email);
                    }
                })
                .setNegativeButton(android.R.string.cancel, null)
                .create().show();
            break;
        case R.id.signoutItem:
            FirebaseAuth mAuth = FirebaseAuth.getInstance();
            mAuth.signOut();
            Intent it = new Intent(this, CheckLoginActivity.class);
            startActivity(it);
            ActivityCompat.finishAffinity(this);
            break;
    }
    return true;
}
 
开发者ID:feliperce,项目名称:MyNotes,代码行数:31,代码来源:EditProfileActivity.java

示例4: beforeClass

import com.google.firebase.auth.FirebaseAuth; //导入方法依赖的package包/类
@BeforeClass
public static void beforeClass(){
    //First we make to sign out
    FirebaseAuth fAuth = FirebaseAuth.getInstance();
    fAuth.signOut();
}
 
开发者ID:victoraldir,项目名称:BuddyBook,代码行数:7,代码来源:LoginWithEmailTest.java

示例5: onStart

import com.google.firebase.auth.FirebaseAuth; //导入方法依赖的package包/类
@Override
public void onStart() {
        super.onStart();

        FirebaseAuth mAuth = FirebaseAuth.getInstance();
        FirebaseUser currentUser = mAuth.getCurrentUser();

        if (currentUser == null) {
                mAuth.signOut();
                Intent i = new Intent(MapsActivity.this, Login.class);
                startActivity(i);
                finish();
        }
        else {
                /*SharedPreferences myPrefs = this.getSharedPreferences("contact", MODE_WORLD_READABLE);
                busNumber = myPrefs.getString("password", "b1");*/
                busNumber = "b1";
                Log.d(TAG, "initial busNumber = " + busNumber);

                switch (busNumber) {
                        case "busNumber1" :
                                busNumber = "b1";
                                break;
                        case "busNumber2" :
                                busNumber = "b2";
                                break;
                        case "busNumber3" :
                                busNumber = "b3";
                                break;
                        case "busNumber4" :
                                busNumber = "b4";
                                break;
                        case "busNumber5" :
                                busNumber = "b5";
                                break;
                }
        }
        Log.d(TAG, "onStart fired ..............");
        mGoogleApiClient.connect();
        if (!checkPermissions()) {
                requestPermissions();
        }
}
 
开发者ID:kuldeep725,项目名称:VEHICLE-APP,代码行数:44,代码来源:MapsActivity.java

示例6: logout

import com.google.firebase.auth.FirebaseAuth; //导入方法依赖的package包/类
public void logout() {
    FirebaseAuth firebaseAuth = FirebaseAuth.getInstance();
    firebaseAuth.signOut();
}
 
开发者ID:VidyaSastry,项目名称:Opal-Chat-AnalyticsDashboard,代码行数:5,代码来源:HomeActivity.java


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