package com.edittextrequestfocus_android_examples.com;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;


public class MainActivity extends Activity {

	EditText one,two;
	Button first,second;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        one = (EditText)findViewById(R.id.editText1);
        two = (EditText)findViewById(R.id.editText2);
        first = (Button)findViewById(R.id.button1);
        second = (Button)findViewById(R.id.button2);
        
        first.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				
				one.requestFocus();
				
			}
		});
        
        second.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				
				two.requestFocus();
				
			}
		});
        
    }
}
