Android Question Action key not changed by setting Force Done = true

Martincg

Member
Licensed User
Longtime User
I have used the IME library so that I can keep the keyboard on screen all the time for a certain activity.

There is one TextEdit for the text and I have tried with "Force Done" set to true and false.

The action key text is "Finished". How do I change it?
(Nexus 7)
 

mangojack

Well-Known Member
Licensed User
Longtime User
try this ... change to array value to suit . See Here ... IME_ACTIONS ...
B4X:
Dim jo As JavaObject = EditText1
jo.RunMethod("setImeOptions", ArrayAsObject(6)) '6 = EditorInfo.IME_ACTION_DONE
 
Last edited:
Upvote 0

Martincg

Member
Licensed User
Longtime User
Thanks for your suggestion mangojack.

Unfortuneately I don't understand what you meant.

What is ArrayAsObject(6) ?


I read the link you gave but I have no idea how to use most of that information . There is

public CharSequence actionLabel

but how do I set that from B4A?

I found this code gives me a way to set the text or symbol I want.
B4X:
Dim ref As Reflector
    ref.Target = EditText1
    ref.RunMethod2("setImeOptions",0x08000001, "java.lang.int") 'IME_FLAG_NO_EXTRACT_UI |IME_ACTION_SEND constants
'IME_ACTION_SEND = 1 ->enter symbol,
'2 -> "Go",
'3  -> magnifying glass(Search),
'4 -> "Send",
'5 -> "Next",
'6 -> "Finished",
'7 -> "Prev",

And if I don't want the action key to change after pressing it the first time I can just call that code again.

So my problem is resolved.:)
 
Upvote 0

mangojack

Well-Known Member
Licensed User
Longtime User
It should have been 'Array As Object' and achieves the same ...
B4X:
Dim jo As JavaObject = EditText1
jo.RunMethod("setImeOptions", Array As Object(6)) '6 = EditorInfo.IME_ACTION_DONE

'IME_ACTION_SEND = 1 ->enter symbol,
'2 -> "Go",
'3 -> magnifying glass(Search),
'4 -> "Send",
'5 -> "Next",
'6 -> "Done",
 
Upvote 0
Top