package com.example.rita.attender;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;


public class loginPageActivity extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login_page);
    }

    public void confirmPressed(View v)
    {

        Intent intent=new Intent(this,CalendarPageActivity.class);
        startActivity(intent);
    }
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_login_page, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }


    private void printAlertDialog(String message)
    {
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle("LOGIN DIALOG");
        builder.setMessage(message);
        builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int id) {
                        //do things
                    }
                });
        builder.setNegativeButton("NO", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int id) {
                //do things
            }
        });
        builder.show();
    }
}

@@ -290,16 +290,189 @@
 .View;%0A%0A
+import com.attender.R;%0Aimport com.facebook.AccessToken;%0Aimport com.facebook.CallbackManager;%0Aimport com.facebook.FacebookSdk;%0Aimport com.facebook.appevents.AppEventsLoger;%0A%0A
 %0Apublic 
@@ -520,24 +520,62 @@
 Activity %7B%0A%0A
+    CallbackManager callbackManager;%0A%0A
     @Overrid
@@ -690,53 +690,832 @@
     
-setContentView(R.layout.activity_login_page);
+FacebookSdk.sdkInitialize(this.getApplicationContext());%0A        setContentView(R.layout.activity_login_page);%0A        %0A        callbackManager = CallbackManager.Factory.create();%0A        %0A        //TODO: check facebook login%0A        if(AccessToken.getCurrentAccessToken() != null)%0A        %7B%0A            Intent intent = new Intent(this, CalendarPageActivity.class);%0A            startActivity(intent);%0A        %7D%0A    %7D%0A%0A    @Override%0A    protected void onResume()%0A    %7B%0A        super.onResume();%0A        // Logs 'install' and 'app activate' App Events.%0A        AppEventsLogger.activateApp(this);%0A        %0A        //TODO: check facebook login%0A        if(AccessToken.getCurrentAccessToken() != null)%0A        %7B%0A            Intent intent = new Intent(this, CalendarPageActivity.class);%0A            startActivity(intent);%0A        %7D
 %0A   

add removed by merge lines