I am making an android app using Firebase and FirebaseUI. The app allows sign in with email and password, google and facebook. How do I find which of these sign in methods was used by the user?
Describing the flow here:
- User sees login screen (FirebaseUI)
- User uses preferred sign in method and signs in
- Next layout is shown according to the sign-in method used by the user
For example
//this activity is launched after successful sign in
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if(/*signed in with email-password*/)
setContentView(R.layout.activity_main_email);
else if(/*signed in with google*/)
setContentView(R.layout.activity_main_google);
else //signed in with facebook
setContentView(R.layout.activity_main_facebook);
//do something
}