You are not setting your contentview
and the activity crashes with a null pointer exception, in the onCreate method you must set a contentView
before being able to try to findViewById
, something like this:
setContentView(R.layout.activity_layout);
Now that you have an actual View in your activity, you can go for spinnr = (Spinner) findViewById(R.id.spinner);
, notice that the crash do not happen when trying to find the view, it happens when you tried to set the adapter, because the reference returned in findViewById
is null.
Try to read a good book about Android basics if you have the chance to, so you won't bump with simple things...
Hope this Helps.
Regards!