Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

android - Where to put Firebase.setAndroidContext() function

I'm trying to play a bit with Firebase and Android.
I have one RegisterActivity, and one MainActivity. My current flow is - start with MainActivity - check if user is registered, if not, call RegisterActivity - after registeration call MainActivity.

I'm having trouble with where to put the Firebase.setAndroidContext() call.
I have 2 questions:

  1. Should I only call this function once in Application or once in each Activty?
  2. If the answer for question 1 is only once, then where should I put it ?

Thank you all, Giora.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...