today:
155
yesterday:
251
Total:
1,112,089

Main Activity

admin 2017.06.02 13:27 Views : 48

package com.jckim.joseph.gmiretreatapplication;

import android.content.Context;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {

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

        Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(mToolbar);


        Button aboutbutton = (Button)findViewById(R.id.aboutbutton);
        Button locationbutton = (Button)findViewById(R.id.locationbutton);
        Button contactbutton = (Button)findViewById(R.id.contactbutton);

        aboutbutton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                Intent intent1 = new Intent(MainActivity.this, AboutGMICenter.class);
                startActivity(intent1);
            }
        });


        locationbutton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                Intent intent2 = new Intent(MainActivity.this, MapsActivity.class);
                startActivity(intent2);
            }
        });


        contactbutton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                Intent intent3 = new Intent(MainActivity.this, ContactActivty.class);
                startActivity(intent3);
            }
        });

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater mMenuInflater = getMenuInflater();
        mMenuInflater.inflate(R.menu.gmi_menu,menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if(item.getItemId() == R.id.action_home){
            Intent intent4 = new Intent(MainActivity.this, MainActivity.class);
            startActivity(intent4);
        }
        if(item.getItemId() == R.id.action_about_gmi){
            Intent intent5 = new Intent(MainActivity.this, AboutGMICenter.class);
            startActivity(intent5);
        }
        if(item.getItemId() == R.id.action_location){
            Intent intent6 = new Intent(MainActivity.this, MapsActivity.class);
            startActivity(intent6);
        }

        if(item.getItemId() == R.id.action_contact){
            Intent intent7 = new Intent(MainActivity.this, ContactActivty.class);
            startActivity(intent7);
        }


        return super.onOptionsItemSelected(item);
    }
}
No. Subject Author Date Views
28 Contact Activity admin 2017.06.04 75
27 About GMI Center admin 2017.06.04 69
26 MainActivity(IOS) admin 2017.06.04 52
25 MainActivity admin 2017.06.04 56
24 Change Project Name admin 2017.06.03 55
23 Menu admin 2017.06.02 46
22 mnifest solatoz 2017.06.02 45
21 Strings admin 2017.06.02 68
20 Google Maps Api .xml admin 2017.06.02 72
19 Swipe Activity layout admin 2017.06.02 55
18 Map Activity Layout admin 2017.06.02 49
17 Main Activity Layout admin 2017.06.02 83
16 Contact Activity Layout admin 2017.06.02 75
15 Activity About Center (layout) admin 2017.06.02 69
14 Map Activity admin 2017.06.02 51
» Main Activity admin 2017.06.02 48
12 Scrolling Activity admin 2017.06.02 55
11 Contact Activity admin 2017.06.02 73
10 About Center (class) admin 2017.06.02 55
9 AndroidManifest.xml solatoz 2017.06.02 110