File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed
app/src/main/java/tech/akpmakes/android/taskkeeper Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change 3232import io .fabric .sdk .android .Fabric ;
3333import tech .akpmakes .android .taskkeeper .models .WhenEvent ;
3434
35- public class MainActivity extends AppCompatActivity implements AddItemDialog .AddItemDialogListener {
35+ public class MainActivity extends AppCompatActivity implements AddItemDialog .AddItemDialogListener , FirebaseAuth . AuthStateListener {
3636 private static final String TAG = "MainActivity" ;
3737 private FirebaseAuth mAuth ;
3838 private FirebaseRemoteConfig mRemoteConfig ;
@@ -45,6 +45,7 @@ protected void onCreate(Bundle savedInstanceState) {
4545 super .onCreate (savedInstanceState );
4646 Fabric .with (this , new Crashlytics ());
4747 mAuth = FirebaseAuth .getInstance ();
48+ mAuth .addAuthStateListener (this );
4849
4950 mRemoteConfig = FirebaseRemoteConfig .getInstance ();
5051 FirebaseRemoteConfigSettings remoteConfigSettings = new FirebaseRemoteConfigSettings .Builder ()
@@ -89,16 +90,8 @@ private void applyRemoteConfig() {
8990 // NOOP for now.
9091 }
9192
92- @ Override
93- public void onStart () {
94- super .onStart ();
95-
96- mAuth .addAuthStateListener (new FirebaseAuth .AuthStateListener () {
97- @ Override
98- public void onAuthStateChanged (@ NonNull FirebaseAuth firebaseAuth ) {
99- updateUI (firebaseAuth .getCurrentUser ());
100- }
101- });
93+ public void onAuthStateChanged (@ NonNull FirebaseAuth auth ) {
94+ updateUI (auth .getCurrentUser ());
10295 }
10396
10497 @ Override
You can’t perform that action at this time.
0 commit comments