Sub Button1_Click
' Dim WhatSentence As String = "Please test This sentence As to Why it Is missing Words in the InputMapAsync"
Dim WhatSentence As String = "The record of the genealogy of Jesus the Messiah the son of David the son of Abraham"
'the and of words are not included with the second WhatSentence!!!! why???
Dim sa1() As String
sa1 = Regex.Split(" ", WhatSentence)
Dim rlst As List
rlst.Initialize
For Each s1 As String In sa1
rlst.Add(s1.Trim)
Next
'Store it in the Map
Dim m As Map
m.Initialize
For x = 0 To rlst.Size -1
Log(rlst.Get(x))
m.Put(rlst.Get(x), False)
Next
'Show the list
InputMapAsync(m, "Select the words", False)
Wait For InputMap_Result
End Sub
I can't figure out what i am doing wrong. The second WhatSentence has missing words in InpuMapAsync, but the first one is ok. They are all separated with space, regex and added to the map.
This is not possible. I tried it and looks like map is involved with ListTemplate.SelectedItems. I selected all the words and the duplicates will not be shown in ListTemplate.SelectedItems. I can understand the list should not have duplicates. But it will be nice to allow it.
I guess im going with your second option. I need to research how to use BCTextEngine .
'Part of my codes (the lWords contains the WhatSentences from the above and are seperated into 17 word list items.
B4X:
Dim ListTemplate As B4XListTemplate
ListTemplate.Initialize
ListTemplate.MultiSelectionMinimum = 1
ListTemplate.Options = lWords
ListTemplate.AllowMultiSelection = True
Wait For (Dialog.ShowTemplate(ListTemplate, "OK", "", "CANCEL")) Complete (Result As Int)
If Result = XUI.DialogResponse_Positive Then
Dialog.Show($"You selected: ${ListTemplate.SelectedItems}"$, "OK", "", "")
The idea of the project is allow multiple words be selected and translated through the web. I guess i have to go with single click word to translate with BCTextEngine or I might consider customlistview with checkbox. That should work.