Android Question capitalize all characters...problem

mw71

Active Member
Licensed User
Longtime User
i test the follow Code, but it does not work
B4X:
lbl_call.InputType=Bit.Or(lbl_call.INPUT_TYPE_TEXT,4096)
(lbl_call is an EditText, Generate by Designer, Dim in Globals)

what am I doing wrong?
 

Cableguy

Expert
Licensed User
Longtime User
Have you tried stringUtils?
 
Upvote 0

mw71

Active Member
Licensed User
Longtime User
No,
I do not know how to deal with this problem.
I use it so far (only) for MeasureMultilineTextHeight and LoadCSV2
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
to capitalize a string use the ToUpperCase method of the string object.
to achieve what you need, use it inside the ValueChanged
 
Upvote 0

mw71

Active Member
Licensed User
Longtime User
on this possibility I have already thought, but it is not a "clean" solution.
I find it better, if the keyboard is set to upper-case letters by the Code.
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
According to this old thread (2012), user @Smee was having issues but realized that
I had mistakenely initialised the text box earlier which seems to have stopped it working properly
.
 
Upvote 0

mw71

Active Member
Licensed User
Longtime User
thanks for the Answer,

unfortunately I do not understand what he did exactly.
I Initialize the EditText (only once) in which I load it because it was created with the designer.
I can not make any adjustments to this before.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I the EditText was added through a Designer Layout you SHOULD NOT initialize it!!
You just need to have it dimed in the appGlobals sub, and for that, you use the "generate members" in the designer's tools
 
Upvote 0

mw71

Active Member
Licensed User
Longtime User
I the EditText was added through a Designer Layout you SHOULD NOT initialize it!!
You just need to have it dimed in the appGlobals sub, and for that, you use the "generate members" in the designer's tools
that's what I'm exactly doing!
I load it whith the complete Layout.
If I initialize it and set it before (which is not correct!), it would be reset by loading the layout again

so I do not understand what Smee does. Do he creates it in the code or was the error at other place
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
You may have to post a project that can reproduce the issue.
 
Upvote 0

mw71

Active Member
Licensed User
Longtime User
here a small test project. I hope it helps.
In the field Call (dim as lbl_Call), the keyboard is only to enter uppercase letters.
(CapsLock should be activated)
 

Attachments

  • Test_UpCase.zip
    9.9 KB · Views: 288
Upvote 0

OliverA

Expert
Licensed User
Longtime User
CapsLock is activated. I'm using B4A 7.3, my target was API Level 24, Intel Atom (x86) CPU/ABI. The only way I could circumvent the capitalization was by picking a auto-corrected/suggested word that includes lower case characters.
 

Attachments

  • upload_2017-9-10_16-18-7.png
    upload_2017-9-10_16-18-7.png
    40.8 KB · Views: 236
  • upload_2017-9-10_16-18-50.png
    upload_2017-9-10_16-18-50.png
    43.4 KB · Views: 236
Upvote 0

mw71

Active Member
Licensed User
Longtime User
thanks for Test/scrennshots

i Test with Motorola/Android 6.x and Samsung/Android 5.x Device, not in Emulator.
Is there a difference (o.k., other API Level, but it was add in API Level 3)??
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Running the app via B4A-Bridge on a Moto-X (XT1058) running Android 5.1 (Using API22), the CapsLock is on.
 
Upvote 0
Top