Is there a difference between "View v" and "View view" in Android studio?

0

When I do the methods to switch between screens:

public void nombreMetodo (View v){ 
   Intent uno = new Intent (this, nombreJava.class); 
   startActivity (uno); 
}

Whenever I do the "public void nombreMetodo (View v)" when writing the View I give space and it suggests view in lowercase. Then I have doubts about whether there is a problem in using pure "v" as usual or it is better to use "view" .

Android Studio Code

 public void reg (View view){
      Intent pa = new Intent(this, MainActivity.class);
      startActivity(pa);
  }
    
asked by Ladiv 01.10.2017 в 22:44
source

1 answer

0

There is no difference, you only indicate the name of the variable of this type can be v , view or any other name, for example rootView :

public void nombreMetodo(View rootView){ 
   ...
   ...
}

Even in the SDK you can find methods with different variable names like drawerView :

   @Override
    public void onDrawerClosed(View drawerView) {
    }

Remember that by Java convention, variable names start with lowercase.

    
answered by 03.10.2017 в 06:46