package com.ahau.againstpest.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.RelativeLayout;

import com.ahau.againstpest.R;

public class SearchActivity extends AppCompatActivity implements View.OnClickListener {

    private RelativeLayout againpest_layout, location_layout;

    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_search);
        intiViews();
    }

    private void intiViews() {
        againpest_layout = (RelativeLayout) findViewById(R.id.againpest_layout);

        againpest_layout.setOnClickListener(this);

        location_layout = (RelativeLayout) findViewById(R.id.position_layout);
        location_layout.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {

        switch (v.getId()) {

            case R.id.againpest_layout:
                Intent intent = new Intent();
                intent.setClass(this, AgainPestActivity.class);
                startActivity(intent);
                break;

            case R.id.position_layout:
                Intent intent1 = new Intent();
                intent1.setClass(this, LocationActivity.class);
                startActivity(intent1);
                break;

            default:
                break;
        }
    }
}
