I created a spinner in my code ( not in designer)
but the initialize method line gives me an error:
B4X:
java.lang.RuntimeException: Don't call setOnClickListener for an AdapterView. You probably want setOnItemClickListener instead
I didnt set any click listener for this view. Why am i getting it ? I searched the forum for the error msg, some people say stg about openspinner but i couldnt understand what it is .
Sub labelinstructionsec_ItemClick (Position As Int, Value As Object)
Dim lbl As Spinner = Sender
isayisi=lbl.tag
labelinstructionsec(isayisi).clear
labelinstructionsec(isayisi).Add("Run On Back")
labelinstructionsec(isayisi).Add("Run In Pack")
labelinstructionsec(isayisi).Add("Run In Front of Pack")
labelinstructionsec(isayisi).Add("Run On Lead")
labelinstructionsec(isayisi).SelectedIndex=0
End Sub
I don't know why you get this error.
I would try to put the Initialize out of the JobDone routine, and perhpas change the the event name.
Not sure if this will solve the problem.
Two comments:
- In this line you should use dip values not pure pixel values. panel(i).AddView(labelinstructionsec(i),scrolltraining2.Width/2-135dip,75,270,30)
- I don't see where you add the labelinstructionsec(i).Tag property.
I don't know why you get this error.
I would try to put the Initialize out of the JobDone routine, and perhpas change the the event name.
Not sure if this will solve the problem.
Two comments:
- In this line you should use dio values not pure pixel values. panel(i).AddView(labelinstructionsec(i),scrolltraining2.Width/2-135dip,75,270,30)
- I don't see where you add the labelinstructionsec(i).Tag property.
How can i get the initalize out of jobdone ? the spinners are initialized according to data received in jobdone so i think it is not possible to move it. I also changed the event name but no luck..
Yeah i will change them to dip , it is a project from b4i so it takes some time to change all those =)
This means that you are calling Jobdone only once, otherwise you will add new instances of the panels.
I don't understand why you get this error. I made a very small test program, without http, and get no error.
This means that you are calling Jobdone only once, otherwise you will add new instances of the panels.
I don't understand why you get this error. I made a very small test program, without http, and get no error.
I use scroll and with every jobdone i clear everything on the scroll so when i call it multiple times no problem occurs. Anyways thanks for your help , i also dont know why i am getting it . I will report back if i can fix that.
This means that you are calling Jobdone only once, otherwise you will add new instances of the panels.
I don't understand why you get this error. I made a very small test program, without http, and get no error.
you were right. I had changed the event name , but there were 2 spinners i only changed one of them. Later i realized there are 2 so when i change the eventname of both spinenrs the problem fixed. Thanks so much !