1
I’m creating a test app with the basic knowledge I acquired on android since I was a java programmer before. All the tutorials I researched people put the class View
as a standard parameter in your methods, but no one explained why, and hj I went to test in this application if it worked without passing the class parameter View
and it was incredibly wrong! I would like to know why it is necessary to pass the View class as a parameter of my methods and if in any case I can omit (specify)?
public void abrirBrowser(View view) {
Uri url = Uri.parse("http://google.com");
Intent i = new Intent(Intent.ACTION_VIEW, url);
startActivity(i);
}
Can you exemplify this behavior?? It’s not all methods that need view.. It depends on what you’re going to do, but an example code to clarify
– leofontes
Let me give you an example:
– Anderson Santos
Example given in the question update.
– Anderson Santos