package fishrungames.kobserver;

import fishrungames.kobserver.JniWrapper;

import android.app.Activity;
import android.content.Intent;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;



public class MainMenuActivity extends Activity
{
	
	@Override
	protected void onCreate(Bundle icicle)
	{

		super.onCreate(icicle);

		//setContentView(R.layout.connect_layout);
		setContentView(R.layout.main_menu_layout);
		
		JniWrapper.StartUpdateMapLocation(this);
		
		Button mapbtn = (Button) findViewById(R.id.mapButton);
		mapbtn.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent myIntent = new Intent(view.getContext(), MapActivity.class);
                startActivityForResult(myIntent, 0);
            }
        });

        Button profilebtn = (Button) findViewById(R.id.profileButton);
        profilebtn.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent myIntent = new Intent(view.getContext(), ProfileActivity.class);
                startActivityForResult(myIntent, 0);
            }
        });

        
        Button alarmbtn = (Button) findViewById(R.id.alarmButton);
        alarmbtn.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent myIntent = new Intent(view.getContext(), AlarmActivity.class);
                startActivityForResult(myIntent, 0);
                
                JniWrapper.MapState = 2;
                JniWrapper.SetAlarmCommon();
                
            }
        });

        
        Button messagesbtn = (Button) findViewById(R.id.messagesButton);
        messagesbtn.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                Intent myIntent = new Intent(view.getContext(), MessagesActivity.class);
                startActivityForResult(myIntent, 0);
            }
        });
        
        Button backbtn = (Button) findViewById(R.id.disconnectButton);
        backbtn.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                JniWrapper.Close();
                JniWrapper.connected = false;
                JniWrapper.StopGetMessageTimer();
            	Intent myIntent = new Intent(view.getContext(), ConnectActivity.class);
                startActivityForResult(myIntent, 0);
            }
        });

		
	}

}