質問

****SOLVED****

I just had to use button set enable property correctly. I was defining the enable property false before the declaration of button . It was a very silly mistake.


****QUESTION****

I have an android with three spinners getting their data dynamically using rest services. The problem is if i click the save button in the bottom while the spinners are still being loaded. the app crashes. what i am trying to achieve is a method to disable my button click till spinners load their value. I tried setEnabled property & set clickable property. but none helped. i need help in this kind of validation .

else if(spinner1.getSelectedItem().toString().trim().equals(""))
         {  

            Toast.makeText(HourlyEntry.this,"Please wait..", Toast.LENGTH_SHORT) .show();  
             return false;  
        }

Logcat

enter image description here

役に立ちましたか?

解決

Please check the enable state of the button. You must be declaring it before declaration.

Spinner spinner1;
Spinner1.enable =true 
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top