Getting null pointer exception when I click on spinner to select item?

Try like this MyOnItemSelectedListener myOnItemSelectedListener = new MyOnItemSelectedListener() ArrayAdapter adapter = new ArrayAdapter(this,android.R.layout. Simple_spinner_item, val); adapter. SetDropDownViewResource(android.R.layout.

Simple_spinner_dropdown_item); spn1. SetAdapter(adapter); spn1. SeOnItemSelectedListener( myOnItemSelectedListener).

Try like this. MyOnItemSelectedListener myOnItemSelectedListener = new MyOnItemSelectedListener(); --------------------- ArrayAdapter adapter = new ArrayAdapter(this,android.R.layout. Simple_spinner_item, val); adapter.

SetDropDownViewResource(android.R.layout. Simple_spinner_dropdown_item); spn1. SetAdapter(adapter); spn1.

SeOnItemSelectedListener( myOnItemSelectedListener).

I have tried this but no profit for me – iShrey Aug 18 at 9:57 declare 'adapter' and 'spn1' as a class variable. – jainal Aug 18 at 10:00.

String PayoutNo = spnPayout. This, "selected item is"+PayoutNo, Toast. //String PayoutNo = spnPayout.

StrPayoutNo = PayoutNo.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions


Thank You!
send