Android Question how to give a value from the ((spinner))

Khalid.

Member
how to give a value from the ((spinner)), substitute for the values 40,56


B4X:
For i = 8 To 100 Step 8

Spinnerwidth.Add(i)

Spinnerheight .Add(i)

Next

bmpRose = xui.LoadBitmapResize ( File.DirAssets , " Untikktled.jpg " , [COLOR=rgb(65, 168, 95)]40,56[/COLOR] , True )
>>>It's error when adding <<<

bmpRose = xui.LoadBitmapResize ( File.DirAssets , " Untikktled.jpg " , [COLOR=rgb(184, 49, 47)]Spinnerwidth,Spinnerheight[/COLOR] , True )
 

Serge Bertet

Active Member
Licensed User
Make a small project example and post it here.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
What exactly do you want to do ?

You can get a Spinner value with:
B4X:
SpinnerWidth.GetItem(Index)
Index is the position in the Spinner.

You can get the currently selected item with:
B4X:
CurrentWidth = SpinnerWidth.SelectedItem

You can add two event routines which are called when a Spinner item is clicked:
B4X:
Private Sub SpinnerWidth_ItemClick (Position As Int, Value As Object)
    CurrentWidth = Value
End Sub

Private Sub SpinnerHeight_ItemClick (Position As Int, Value As Object)
    CurrentHeight = Value
End Sub
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
In your code, you try to get values from the Spinner before you have filled them !?
And then, what do you want to do with other values from the Spinners.
You have no code when the user selects a new value from a Spinner.
So, as I do not understand the logic of your code, I want to understand what your problem is.
So, what do want to do with your program ?
I prefer solving problems instead of just answering a question, which does not reflect the problem.
 
Last edited:
Upvote 0
Top