Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 16090

Android Studio System.out.println not working

$
0
0

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.


Viewing all articles
Browse latest Browse all 16090

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>