title: How to call another activity method in android studio?
body: <p>I have two different activities.
  The first calls the menu(base) if the user is logged in, but have also the method for display the user information. </p>
  
  <pre><code>public class MainActivity extends ActionBarActivity implements View.OnClickListener {
  
      UserLocalStore userLocalStore;
      EditText etName, etAge, etUsername;
      Button bLogout;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          etUsername = (EditText) findViewById(R.id.etUsername);
          etName = (EditText) findViewById(R.id.etName);
          etAge = (EditText) findViewById(R.id.etAge);
          bLogout = (Button) findViewById(R.id.bLogout);
  
          bLogout.setOnClickListener(this);
  
          userLocalStore = new UserLocalStore(this);
      }
  
      @Override
      public void onClick(View v) {
          switch (v.getId()){
              case R.id.bLogout:
                  userLocalStore.clearUserData();
                  userLocalStore.setUserLoggedIn(false);
                  Intent loginIntent = new Intent(this, Login.class);
                  startActivity(loginIntent);
                  break;
          }
      }
  
      @Override
      protected void onStart() {
          super.onStart();
          if (authenticate() == true) {
              startActivity(new Intent(this, Base.class));
          }
      }
  
      private boolean authenticate() {
          if (userLocalStore.getLoggedInUser() == null) {
              Intent intent = new Intent(this, Login.class);
              startActivity(intent);
              return false;
          }
          return true;
      }
  
      public void displayUserDetails() {
          User user = userLocalStore.getLoggedInUser();
          etUsername.setText(user.username);
          etName.setText(user.name);
          etAge.setText(user.age + "");
      }
  }
  </code></pre>
  
  <p>The second activity is the menu; this activity has a button called "bUtente" that when clicked must show the user info.</p>
  
  <pre><code>public class Base extends Activity implements View.OnClickListener {
      Button bDiario;
      Button bUtente;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_base);
          bDiario = (Button) findViewById(R.id.bDiario);
          bDiario.setOnClickListener(this);
          bUtente = (Button) findViewById(R.id.bUtente);
          bUtente.setOnClickListener(this);
      }
  
      @Override
      public void onClick(View v) {
          switch (v.getId()){
              case R.id.bDiario:
                  startActivity(new Intent(this, Diary.class));
  
              case R.id.bUtente:
                  MainActivity prova = new MainActivity();
                  prova.displayUserDetails();
          }
      }
  }
  </code></pre>
  
  <p>How can I do that when I click the button "bUtente" reminds me of the other activity by performing the method "displayUserDetails()"?</p>