Android Question B4XPreferencesDialog suggestions from dictionary

jcmartini

Member
Licensed User
Longtime User
Sorry to ask my question at the wrong place.
The solutions I found, were for EditText. With Preferences dialogs we access data from/to a map collection. So how we can't do something like:
"EditText.InputType = Bit.Or(EditText.InputType, 524288)"
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
With Preferences dialogs we access data from/to a map collection. S
Try this code where you expose the native text view of B4XFloatTextField:
B4X:
For i = 0 To prefdialog.PrefItems.Size - 1
        Dim pi As B4XPrefItem = prefdialog.PrefItems.Get(i)
        If pi.ItemType = prefdialog.TYPE_TEXT Then
            Dim ft As B4XFloatTextField = prefdialog.CustomListView1.GetPanel(i).GetView(0).Tag
            Dim et As EditText= ft.TextField  'expose native text view
            et.InputType = Bit.Or(et.InputType, 144)  'this one works on my samsung tablet
'            et.InputType = Bit.Or(et.InputType, 524288)  'or this one if above number does not do it 
        End If
    Next
 
Upvote 0

jcmartini

Member
Licensed User
Longtime User
Thanks but It does not work. I get an abend (java.lang.IndexOutOfBoundsException: Index: 0, Size: 0) on line:
Dim ft As B4XFloatTextField = prefDialog.CustomListView1.GetPanel(i).GetView(0).Tag
when I run it with debugging.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
Thanks but It does not work.
It worked for me. I did not post it until I verified it worked for me. You may have to try different views . I have GetView(0), yours may be GetView(1) or something else. If not, someone will come to your rescue.
 
Upvote 0

jcmartini

Member
Licensed User
Longtime User
Finally, I found what it happend:
your routine should be placed after the "wait..." and not before:
B4X:
Wait For (prefDialog.ShowDialog(ResultMap, "OK", "CANCEL")) Complete (Result As Int)
For i = 0 To prefDialog.PrefItems.Size - 1
 ...
 Next
If Result = xui.DialogResponse_Positive Then ....
and initialization should be done in "activity create" of activity.
Thanks for your help !...
 
Upvote 0
Top