June 2018
Beginner to intermediate
394 pages
9h 2m
English
Let's get our hands dirty by instantiating the required classes and methods. In the onCreate(..) method of the Activity, initialize the FirebaseAuth class. Check whether the getCurrentUser method is returning null values. If it returns, ask the user to log in again or else take the user to the next activity:
package com.packt.firebase.mastering.authentication;import android.content.Intent;import android.support.v7.app.AppCompatActivity;import android.os.Bundle;import com.google.firebase.auth.FirebaseAuth;public class MainActivity extends AppCompatActivity { private FirebaseAuth mAuth; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout. ...
Read now
Unlock full access