本文整理汇总了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();
}