I am making an android app. In order to process user input I'm using onStart()
to check for input and then, I call another activity using a button.
protected void onStart()
{
Button searchrestrauntbutton = (Button)findViewById(R.id.search);
searchrestrauntbutton.setOnClickListener(new View.OnClickListener(){
public void onClick(View v)
{
EditText area = (EditText)findViewById(R.id.area);
EditText locality = (EditText)findViewById(R.id.locality);
String area1 = area.getText().toString();
String locality1 = locality.getText().toString();
if(area1.equals(""))
{
area.setError("please enter an area");
}
else if(locality1.equals(""))
{
locality.setError("please provide locality");
}
else
{
Intent intentsearch = new Intent(HomePage.this,displayrestraunt.class);
startActivity(intentsearch);
}
}
});
}