[SOLVED] Refocus On Edit Field

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Googie85
Posts: 199
Joined: Tue Aug 05, 2014 10:07 am

[SOLVED] Refocus On Edit Field

Post by Googie85 » Thu Apr 12, 2018 11:45 am

Hi Guys,

When I focus on an edit field, the keyboard presents fine, but after I move from the edit field, and refocus on it, the keyboard dose not reappear.

Any Ideas?

Many Thanks,

Matthew.
Last edited by Googie85 on Fri Apr 13, 2018 11:47 pm, edited 2 times in total.

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: Refocus Of Edit Field

Post by sphere » Fri Apr 13, 2018 11:54 am

Please share your script, that would help.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9286
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Refocus Of Edit Field

Post by richmond62 » Fri Apr 13, 2018 7:05 pm

the keyboard presents fine
Do you mean that this is running on Android or iOS and the onscreen keyboard appears?

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Refocus Of Edit Field

Post by bogs » Fri Apr 13, 2018 7:34 pm

Googie85 wrote:
Thu Apr 12, 2018 11:45 am
When I focus on an edit field, the keyboard presents fine, but after I move from the edit field, and refocus on it, the keyboard dose not reappear.
Any Ideas?
Well, you could intercept the message, which would be openField, and possibly pop the keyboard that way?

Code: Select all

on openField -- triggered when clicking in the field
  set the keyboardActivated to true
end openField
*Disclaimer - I don't develop for mobile, take with grain of salt.
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9286
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Refocus Of Edit Field

Post by richmond62 » Fri Apr 13, 2018 7:41 pm

Um . . .

How about using on focusIn instead of openField ?

*Disclaimer - I don't develop for mobile, take with several grains of natural, Himalayan salt.

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Refocus Of Edit Field

Post by bogs » Fri Apr 13, 2018 9:27 pm

That sounds good too :mrgreen:

*Disclaimer - I don't develop for mobile, take with several abominable snowmen.
Image

Googie85
Posts: 199
Joined: Tue Aug 05, 2014 10:07 am

Re: [SOLVED] Refocus Of Edit Field

Post by Googie85 » Fri Apr 13, 2018 11:44 pm

Thanks, you guys are awesome!!

trevix
Posts: 958
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: [SOLVED] Refocus On Edit Field

Post by trevix » Tue Aug 04, 2020 11:38 am

"set the keyboardActivated to true" will never work, because is a message sent to the current card. Can't be set.

I am having the same problem, that is:
- click on a Android (7.0 hardware) field in order to edit. OK
- write your stuff and click on a different field in order to write or edit the second field
- the keyboard disappear (noOK)

This doesn't happens on iOS
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

trevix
Posts: 958
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: [SOLVED] Refocus On Edit Field

Post by trevix » Tue Aug 04, 2020 12:24 pm

Whatever it means, I discovered that if I put this in the 2 fields, the keyboard behave correctly:

Code: Select all

on openField
     if environment() = "mobile" then
          answer "something"
     end if
end openField
Now I only need to find something a little less "intrusive"...
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

trevix
Posts: 958
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: [SOLVED] Refocus On Edit Field [NOW IS SOLVED]

Post by trevix » Tue Aug 04, 2020 1:12 pm

OK. I I put this on the 2 fields, the keyboards behave correctly.

Code: Select all

on openField
     if environment() = "mobile" then
          wait 10 milliseconds
          focus on me
     end if
end openField
It shouldn't need this, tought
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

Post Reply

Return to “Android Deployment”