Why does my app keep crashing?
I am creating an app that uses an age restriction when started and this is what I am working on first, but when I run my appit crashes immediately with no prompt and with no 'this app has stopped', notification. I am using android studio. There is no problem with android studio because I have run different sets oof code and projects and they turn out fine. It crashes on both the emulator and adb device. I have attached the code. Please ask for anything else and help as soon as possible import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import java.util.Scanner; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Scanner s1 = new Scanner(System.in); System.out.println(s1.nextInt()); int age = s1.nextInt(); if (age < 0) { System.out.