Running this code (It has no errors) on android emulator gives a message saying 'Unfortunately, the app has stopped'

Printable View