title: Can't call method in another class - ANDROID
body: <p>recently i opened a question about how to call a method in another class... ok, i did call the example method, but the method i really want to call isn't working:</p>
  
  <p>I have 2 classes: </p>
  
  <p>I want to call the method here: <code>TelaCadastroRestaurante.java</code></p>
  
  <p>I have the method here: <code>Metodos.java</code></p>
  
  <p><a href="http://i.imgur.com/JVMjz8J.png" rel="nofollow">http://i.imgur.com/JVMjz8J.png</a></p>
  
  <p><a href="http://i.imgur.com/IuBTmCY.png" rel="nofollow">http://i.imgur.com/IuBTmCY.png</a></p>
  
  <hr>
  
  <p>public class TelaCadastroRestaurante extends Activity {</p>
  
  <pre><code>private EditText nomeRestaurante, emailRestaurante, telefoneRestaurante;
  private Button buttonProximo;
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_tela_cadastro_restaurante);
      incializarComponentes();
      acaoBotoes();
  }
  
  public void incializarComponentes() {
      nomeRestaurante = (EditText) findViewById(R.id.editTextNomeRestauranteTelaCadastroRestaurante);
      emailRestaurante = (EditText) findViewById(R.id.editTextEmailRestauranteTelaCadastroRestaurante);
      telefoneRestaurante = (EditText) findViewById(R.id.editTextTelefoneRestauranteTelaCadastroRestaurante);
      buttonProximo = (Button) findViewById(R.id.buttonProximoTelaCadastroRestaurante);
  
  }
  
  public void acaoBotoes() {
      buttonProximo.setOnClickListener(new OnClickListener() {
          @Override
          public void onClick(View v) {
  
              Metodos metodos = new Metodos();
              Metodos.taskInProgres(true, getApplicationContext());       
          }
      });
  }
  
  public void pegarValores(){
  
      Restaurante rest = new Restaurante();
  
      rest.setNomeRest(nomeRestaurante.getText().toString());
      rest.setEmailRest(emailRestaurante.getText().toString());
      rest.setTelefoneRest(Integer.parseInt(telefoneRestaurante.getText().toString()));
  
      Toast.makeText(getApplicationContext(), rest.getNomeRest() + "\n" +  rest.getEmailRest() + "\n" + rest.getTelefoneRest(), Toast.LENGTH_SHORT).show();
  }
  </code></pre>
  
  <p>}</p>
  
  <p><strong>CLASS WITH METHODS</strong></p>
  
  <p>public class Metodos {</p>
  
  <pre><code>private static ProgressDialog dialog;
  
  public static void taskInProgres(boolean mostrar, Context context) {
  
      if (dialog == null) {
          dialog = new ProgressDialog(context);
          dialog = ProgressDialog.show(context, "","Aguarde a verificação...", true);
      }
      if (mostrar) {
          dialog.show();
      } else {
          dialog.dismiss();
      }
  }
  </code></pre>
  
  <p>}</p>