Android Question views for labels and spinners

Subatanx86

Member
Licensed User
I'm using the below code for an Edit Text field and that works fine. Is there something like Input Type for content stored in a label or spinner?

edtEvent.InputType = edtEvent.INPUT_TYPE_TEXT
 
Labels and Spinners are not views for text input.



SQLite has nothing to do with your question; you can edit the thread title:
upload_2019-3-10_6-45-36.png
 
Upvote 0
Right now I'm using the below code. I would prefer for edtIn and edtOut to be labels instead of edit text. Labels do not work with InputType. I'm trying to find something that does.

If FirstTime Then
SQL.Initialize(File.DirInternal, "vet.db", True)
End If
Activity.LoadLayout("Veteran")
pnl1.Visible = True
pnl2.Visible = False

Dim m As Map
m.Initialize
m.Put("ID", DBUtils.DB_TEXT)
m.Put("Event", DBUtils.DB_TEXT)
m.Put("First", DBUtils.DB_TEXT)
m.Put("Last", DBUtils.DB_TEXT)
m.Put("Rank", DBUtils.DB_TEXT)
m.Put("CheckIn", DBUtils.DB_TEXT)
m.Put("CheckOut", DBUtils.DB_TEXT)
DBUtils.CreateTable(SQL, "Vet", m, "ID")



edtEvent.InputType = edtEvent.INPUT_TYPE_TEXT
edtFirst.InputType = edtFirst.INPUT_TYPE_NONE
edtLast.InputType = edtLast.INPUT_TYPE_NONE
edtRank.InputType = edtRank.INPUT_TYPE_NONE
edtIn.InputType = edtIn.INPUT_TYPE_TEXT
edtOut.InputType = edtOut.INPUT_TYPE_TEXT
 
Upvote 0
I want to be able to save text from a label


maybe this?

Code: Copy
Dim Label1 As Label
Dim SavedLabelText As String

SavedLabelText = Label1.Text

and spinner


and this?

Code: Copy
Dim Spinner1 As Spinner
Dim SavedSpinnerText As String

If Spinner1.SelectedIndex <> -1 Then
    SavedSpinnerText = Spinner1.SelectedItem
Else
    SavedSpinnerText = "Nothing selected (yet)"
End If


edit: I wrote this before the above DB posts appeared, but I'll leave it here just in case there's still something of use
 
Last edited:
Upvote 0
Code: Copy
edtIn.InputType = edtIn.INPUT_TYPE_TEXT
edtOut.InputType = edtOut.INPUT_TYPE_TEXT

if edtIn and edtOut are Labels rather than EditTexts, then they are already INPUT_TYPE_TEXT (ie, String) and you don't need to set any input restrictions.

But because they are Labels, the user cannot change the text. You can, though: you can both read (save?) and write the text of a Label using Label.Text.
 
Upvote 0
Back
Top