當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。