package com.beem.project.beem.ui;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import com.beem.project.beem.R;

/**
 * This class is the main Activity for the Beem project.
 * @author Da Risk <darisk972@gmai.com>
 */
public class Login2 extends Activity {

    private static final String TAG = "Login2";

    /**
     * Constructor.
     */
    public Login2() {
    }


    @Override
    protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.login);
    }

    @Override
    protected void onStart() {
	super.onStart();
	Intent i = new Intent (this, LoginAnim.class);
	startActivityForResult(i, 42);
    }

    @Override
    protected void  onActivityResult  (int requestCode, int resultCode, Intent data) {
	if (requestCode == 42) {
	    if (resultCode == Activity.RESULT_OK) {
		Log.d(TAG, "Connected !!! Launch contact list");
		Intent i = new Intent(this, ContactList.class);
		startActivity(i);
		finish();
	    } else if (resultCode == Activity.RESULT_CANCELED) { // or error ? 
		// Set an intent with data in like the error msg
		Log.d(TAG, "NOT Connected !!!");
		
	    }
	}
    }

}
