Estou tendo problemas com o menu. Fica aparecendo o erro "Cannot resolve method inflate(int, Android.view.Menu).
No messages gradle build aparece: Error:(35, 17) error: cannot find symbol method inflate(int,Menu).
Alguém sabe o problema que deu?
Segue o código abaixo até o momento.
package com.example.sugoi.agenda;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
public class FormularioActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_formulario);
Button botaoSalvar = (Button) findViewById(R.id.formulario_salvar);
botaoSalvar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(FormularioActivity.this, "Botão clicado!", Toast.LENGTH_LONG).show();
finish();
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
Menu inflater = (Menu) getMenuInflater();
inflater.inflate( R.menu.menu_formulario, menu);
return super.onCreateOptionsMenu(menu);
}
}