I'm new to Android and I've been trying to figure out what went wrong for an hour now with this code:
public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button button = findViewById(R.id.save_button); botao.setOnClickListener(v -> System.out.println("Button pressed")); }}
It's simply supposed to print that. But the console won't show anything. I don't know what I'm doing wrong.
I've tried creating a simple method to use on the OnClick attribute. But still It does not work.