package com.alorma.github.ui.activity; import android.accounts.Account; import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import java.util.List; public class SplashActivity extends AppCompatActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); AccountsManager accountsFragment = new AccountsManager(); List<Account> accounts = accountsFragment.getAccounts(this); if (accounts.isEmpty()) { Intent intent = new Intent(this, WelcomeActivity.class); startActivity(intent); finish(); } else { Intent intent = new Intent(this, MainActivity.class); startActivity(intent); finish(); } } }