I'm creating a test app with the basic knowledge I got on android since previously I was a java programmer. All of the tutorials I searched for put the View
class as the default parameter in their methods, but no one explained why, and hj I was testing in this application if it worked without passing the class View
as a parameter and incredibly failed! I would like to know why it is necessary to pass the View class as a parameter of my methods and if in some case I can omit (specify)?
public void abrirBrowser(View view) {
Uri url = Uri.parse("http://google.com.br");
Intent i = new Intent(Intent.ACTION_VIEW, url);
startActivity(i);
}