本文整理匯總了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();
}
}
示例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;
}
示例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;
}
示例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();
}
示例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();
}
}
示例6: logout
import com.google.firebase.auth.FirebaseAuth; //導入方法依賴的package包/類
public void logout() {
FirebaseAuth firebaseAuth = FirebaseAuth.getInstance();
firebaseAuth.signOut();
}