cancel
Showing results for 
Search instead for 
Did you mean: 

MDK - setFocus AlwaysHide not working on Android in OnReturning rule

kevinbraun
Discoverer
0 Kudos

My use case is that on the first page there is a simple property that will accept a bar code scan.  Our device (Zebra running Android) has a hardware scan that is a keyboard wedge.  As such, I setFocus on the first page simple property with AlwaysHide, so the user simply performs the hardware scan and the text is set in the field.  Then the user clicks a button to navigate to a second page where they type in a quantity.  As such, on the second page the setFocus is AlwaysShow.  Again the user clicks a confirm button which is a ClosePage action and returns to the first page (performing the default back button also produces the issue).  Back on the first page, I have a OnReturning event with duplicate code to setFocus with AlwaysHide.

This issue is that the AlwaysHide is not respected at this point.  The focus is set as the cursor is placed in the field, but the keyboard does not disappear.  Note that if I back out to the main menu (keyboard still showing at this point) and navigate back to Page 1, the keyboard then disappears from the OnPageLoad rule.

Here's my code, any ideas?

First Page:

mdk setfocus 1.pngmdk setfocus 2.pngmdk setfocus 3.png

Second Page:

mdk setfocus 4.pngmdk setfocus 5.png

View Entire Topic
bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

It seems like once you set AlwaysShow it will show the keyboard everywhere.  I was able to reproduce your behavior using your rules.  The workaround for me was to use Auto instead of AlwaysShow on Page 2.  Then when returning to Page 1 the set Focus correctly went to the input field and the keyboard was hidden.

kevinbraun
Discoverer
0 Kudos
Thank you, this work around work for me as well, not sure why I didn't think of that!