Opening and Closing Keyboard Restarts App

Opening and closing the keyboard always restarts my Corona App. In fact, I can tell that a game was built with Corona if it restarts with the keyboard.

Is there a way to fix this or is this something that Corona is working on for their daily builds? [import]uid: 54716 topic_id: 15600 reply_id: 315600[/import]

Hi,

That`s a strange behaviour as I just have built an sample calc app that does use the keyboard, played it in my iPhone and that is working nice.

I`ve just put the “Touch-focus” on the background to release the keyboard.

I am using the last stable build of Corona - 2011.591 I think.
Regards,
Rodrigo. [import]uid: 89165 topic_id: 15600 reply_id: 57662[/import]

Thanks for the reply. I think it is mostly an Android specific problem. Could you supply some code that explains “releasing the keyboard”? I am having a hard time understanding what you mean. [import]uid: 54716 topic_id: 15600 reply_id: 57665[/import]

Hi!
Maybe it on Android only, btw the code I`ve used to release the Keyboard in the real device was:

[lua]-- Listeners

local listener = function (event)
native.setKeyboardFocus ( nil )
end

yourobject:addEventListener ( “tap”, listener )[/lua]

PS: That just works well on the Real Device as the Corona Simulator cannot get it running as yet. However you can test that building for the Xcode. (oh, sorry…I think you are not on a Mac).

Good Luck!
Rodrigo.

[import]uid: 89165 topic_id: 15600 reply_id: 57677[/import]

I am on mac and pc. What does tap have to do with a keyboard opening and closing? Does a keyboard throw an event or something? [import]uid: 54716 topic_id: 15600 reply_id: 57682[/import]

Hi!

After having the keyboard opened by your, lets say textfield, the focus of the keyboard is set to nil when you touch “anywhere” of your app`s display and so on the keyboard tool is released (be hidden again).

I do not know if I got what you need, anyway just trying to help. BTW I am just starting with Corona so please do not mind. =]

Regards,
Rodrigo.

PS: I think that your problem is other than what I am speaking about because in your first post you said that looks like when calling the keyboard the app lock itself and crash the device and so I really do not know how to solve it. Better to get Ansca reply. Sorry. [import]uid: 89165 topic_id: 15600 reply_id: 57752[/import]

ir8primates,

Are you talking about the opening/closing the devices’s “physical” keyboard? [import]uid: 32256 topic_id: 15600 reply_id: 58429[/import]

Yes, the physical keyboard on phones like the Droid and the G2. [import]uid: 54716 topic_id: 15600 reply_id: 58433[/import]

I’ve just confirmed this as a bug on a Droid now. This issue with the physical keyboard only happens on an app that has a fixed orientation. It does not happen if the app supports multiple orientations (eg: portrait and landscape).

This issue just made it to the top of my list. I’ll work on it as soon as I can. Thanks for reporting it. [import]uid: 32256 topic_id: 15600 reply_id: 58448[/import]

Oh no, I have known about this for months. I should have spoken sooner. Thanks [import]uid: 54716 topic_id: 15600 reply_id: 58455[/import]

This issue is now fixed. The fix will be made available in the next daily build.

Just so you know, the best way to report issues such as this is via the “Report a Bug” link that you see at the top of this web page. This way it gets in our queue. We don’t always notice issues reported on the Forum since it’s used for general conversations and they can get lost in the sea of forum posts.

Again, thanks for reporting this issue. [import]uid: 32256 topic_id: 15600 reply_id: 58464[/import]

Hello,

Maybe I am having a different issue, but I have been having it for months. On a Moto Droid or other Android devices the app will crash or go into limbo basically when you open the keyboard. I have had apps rejects from Amazon because of this. I’ve tried latest daily builds and public release with the same result.

I tend to think this is fixed and I am not doing something. I can’t see this being a problem for so long with physical keyboards being a big deal to many Android users not to mention Amazon rejecting apps because of it. I did manage to get one through on Amazon with this problem but then they rejected an update to it because of this. I guess the first round they did not try the physical keyboard.

Any help on this would be much appreciate. A fix or a way around it would make me happy.

Thanks,
Gary Gindlesperger [import]uid: 8533 topic_id: 15600 reply_id: 59809[/import]

Gary,

I have a Droid that I use for testing and it’s not crashing on me. There’s likely an edge case that we’re not testing for. If you can easily reproduce this crash, then would you mind reporting this as a bug and attach your zipped up project to the bug report please? You can do so by clicking the “Report a Bug” link at the top of this web page. Thanks! [import]uid: 32256 topic_id: 15600 reply_id: 59820[/import]

Thanks Joshua,

Well I wanted to double check my current version. Turns out there are 2 more releases to Daily Builds from the one I had. It does not rest or lock up now, but I do have a problem that after you enter your name in the field and press the return key on the keyboard it does not do anything. If you bring up the on screen keyboard it accepts it when you press done, but not when you press enter on the slide out keyboard.

Is there a solution for this? This is the last real hurdle I have had with Android builds. Once this is resolved everything else I try seems to work.

Thanks again for your fast response. It is greatly appreciated.
Gary [import]uid: 8533 topic_id: 15600 reply_id: 59823[/import]

Gary,

I’m glad the slide-out keyboard issue is fixed for you too. Phew! You had me worried for a bit. :slight_smile:

Regarding the physical Enter key issue, that sounds like something we can easily fix on our end. I’ll look into sneaking it in early next week. [import]uid: 32256 topic_id: 15600 reply_id: 59826[/import]

Thanks again Joshua. I really appreciate your fast response. I believe in the meantime I can get around it by putting a button on the screen for them to push once they have the name entered. I used that trick a few months ago when clicking go on the screen keyboard did not work on some devices.

Gary [import]uid: 8533 topic_id: 15600 reply_id: 59832[/import]

Hi Gary,

I tested the latest daily build on the original Droid that has a slide-out keyboard. Pressing the ENTER key on the keyboard does in fact call the Lua listener with an event.phase set to “ended”. So it looks like it is working. We did make other changes to our text fields since the release, so perhaps we might have accidentally fixed this issue along the way (one can only hope). Would you mind testing with the newest daily build (#633) and see if it is still happening to you?

Thanks! [import]uid: 32256 topic_id: 15600 reply_id: 60248[/import]

Hi Joshua,

I gave this a try and still got the same results. I am using build 632 as when I go to Daily Builds that is the latest one showing for me. I cleared temp files and cash and that is still the newest showing. The code I had checks for event.phase = “submitted” and that works fine for the on screen keyboard. I added code for it to check for event.phase = “ended” and it did not accept the Return on the slide out keyboard. I am using the original Droid by Moto. I know many people I know say they have a Droid, but it is one of the newer types.

Should the physical enter have the phase “submitted” like the on screen keyboard?

What I did was just put a button on the screen that once it is pressed it performs the actions as if they pressed enter on the keyboard.

Any chance you could email me ggindlesperger@shol.com just a sample code that works for you. Maybe something that just has you enter your name and then displays it after you press enter.

Thanks so much for your help. So far I can do anything I want in Android except use the physical keyboard enter.

Gary

[import]uid: 8533 topic_id: 15600 reply_id: 60264[/import]

Gary,

Sorry, I ended up testing for you issue under the wrong version. I’ve tested this on a Droid and Droid2 and confirmed that Corona was not sending “submitted” events in build 632 and 591 (the release version). I’ve just made a fix for it and it will be made available in the next daily build, which should be build #636. In fact, I made several all other text field and keyboard fixes in the upcoming daily build too to better match our iOS implementation.

That said, there is one more bug in the next daily build that you might need to be concerned about. Corona won’t suspend when the user presses the power/screen-lock button. This is not an issue for normal GUI apps, but this will be a problem for games or anything that plays music. [import]uid: 32256 topic_id: 15600 reply_id: 60299[/import]

Joshua,

Thanks so much for your attention and very fast response to this. So I am understanding correct that when this is fixed it will send an event.phase = “submitted” which will make it work just like the return on the on screen keyboard?

Take Care,
Gary [import]uid: 8533 topic_id: 15600 reply_id: 60307[/import]