title: Splash Screen that will check if user is already registered
body: <p>I would like my splash screen to check if the user is already registered: if the person is already registered, it will go a a login screen. Else, it will go a registration activity. I have already created a database class in the same package. The problem I am facing is that this splash screen is not doing its job. When I run the project, it takes me directly to the login screen. I have a feeling the splash screen is skipped... Please Help!</p>
  
  <pre><code>public class SplashScreen extends Activity
  {
  
  protected void onActivityResult(int reqCode, int resultCode, Intent data)
   {
  
  super.onActivityResult(reqCode, resultCode, data); 
  if (resultCode != -1)
  {
      finish();
      Database db = new Database(this);
      int k = db.getCount();
      Log.d("The Number of Row : ", String.valueOf(k));
  
  
      if (k != 0)//If we already have an entry in the database then will move from the splash screen to the loginCode activity
      {
        finish();
        Intent intent1 = new Intent(SplashScreen.this, LoginCode.class);
        startActivity(intent1);
        overridePendingTransition(R.anim.action_fade_in, R.anim.action_fade_out);
      }
  
      else//if launching app the first time then we will need to register
      {
        finish();
        Intent intent2 = new Intent(SplashScreen.this, RegPasscode.class);
        startActivity(intent2);
        overridePendingTransition(R.anim.action_fade_in, R.anim.action_fade_out);
      }
      db.close();
  
    }
  else
  {
      Log.i("RobMeNot", "Administration enable FAILED!");
  
  }
  </code></pre>
  
  <p>}</p>