title: Get Current User Firebase Android
body: <p>Like many developers I am migrating my backend away from Parse after the announcement this week and I can't figure out how to get check if there is currently a user logged in or not. I am using email and password authentication.</p>
  
  <p>Here is my code which does not work:</p>
  
  <pre><code>public class ApplicationStart extends Application {
  
  
  @Override
  public void onCreate() {
      super.onCreate();
      Firebase.setAndroidContext(this);
      Firebase ref = new Firebase(Passwords.FB_LINK);
      AuthData currentUser = ref.getAuth();
      if (currentUser == null) {
          // Take user to log in screen
          Intent intent = new Intent(this, MyIntro.class);
          intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
          startActivity(intent);
      }
      else {
          // User already logged in
          Intent intent = new Intent(this, MainActivity.class);
          intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
          startActivity(intent);
      }
      TwitterAuthConfig authConfig = new TwitterAuthConfig(Passwords.TWITTER_KEY, Passwords.TWITTER_SECRET);
      Fabric.with(this, new TwitterCore(authConfig), new Digits());
     }
  }
  </code></pre>