Highlighted

Hide/dismiss Android soft keyboard?

Community Beginner ,
Nov 01, 2015

Copy link to clipboard

Copied

By adding this code to an AIR app's xml you can set it as the "home" or launcher:


<activity android:name=".AppEntry">
  
<intent-filter>
  
<action android:name="android.intent.action.MAIN" />
  
<category android:name="android.intent.category.HOME" />
  
<category android:name="android.intent.category.DEFAULT" />
  
</intent-filter>
</activity>

Unfortunately, this causes the soft keyboard to display on launch, and doesn't go away until the user interacts with the app. Not only does this look strange and unprofessional, but for an unattended application (like digital signage) it's a deal breaker.

I've Googled until my fingers hurt, but I haven't found a solution. Help!

PS. I should note, I tried this, with no luck: stage.focus = null;@@

TOPICS
Development

Views

2.5K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Hide/dismiss Android soft keyboard?

Community Beginner ,
Nov 01, 2015

Copy link to clipboard

Copied

By adding this code to an AIR app's xml you can set it as the "home" or launcher:


<activity android:name=".AppEntry">
  
<intent-filter>
  
<action android:name="android.intent.action.MAIN" />
  
<category android:name="android.intent.category.HOME" />
  
<category android:name="android.intent.category.DEFAULT" />
  
</intent-filter>
</activity>

Unfortunately, this causes the soft keyboard to display on launch, and doesn't go away until the user interacts with the app. Not only does this look strange and unprofessional, but for an unattended application (like digital signage) it's a deal breaker.

I've Googled until my fingers hurt, but I haven't found a solution. Help!

PS. I should note, I tried this, with no luck: stage.focus = null;@@

TOPICS
Development

Views

2.5K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Nov 01, 2015 0
Engaged ,
Nov 01, 2015

Copy link to clipboard

Copied

Unfortunate I usually have the opposite problem - trying to get the damn thing to appear on Android!

I haven't tried these, but might be worth a shot:

  • First set 'stage.focus' to a valid object (i.e. textfield) and THEN set it to null - maybe even on the next frame?
  • Set TextField.setSelection to illegal values?
  • Set textField.needsSoftKeyboard=false on a textfuield, and then transfer focus to it (and then away again once it's done its job)?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 01, 2015 0
Engaged ,
Nov 02, 2015

Copy link to clipboard

Copied

Oh, just came across this. It might work:

Adobe Flash Platform * Controlling virtual keyboard behavior

"When the keyboard opens, the focused object dispatches the following events in sequence:

softKeyboardActivating event — dispatched immediately before the keyboard begins to rise over the stage. If you call the preventDefault() method of the dispatched event object, the virtual keyboard does not open."

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 02, 2015 0
Engaged ,
Nov 02, 2015

Copy link to clipboard

Copied

I've never run across problems with the soft keyboard on either iOS or Android, though I've a.) never created complicated forms and b.) always used a Feathers TextInput control (which I believe wraps StageText).  So I've never used a standard flash TextField for text input on mobile.    

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 02, 2015 0
Community Beginner ,
Nov 02, 2015

Copy link to clipboard

Copied

This isn't related to any sort of text control. Don't even need text on the stage. Simply add the above to the manifest and it will happen when the app launches.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 02, 2015 0
Engaged ,
Nov 02, 2015

Copy link to clipboard

Copied

Sorry, I couldn't figure out from your original post what exactly you're trying to do with the soft keyboard.  You're trying to make your app into some kind of launcher/home screen? 

In that case, yeah, I can see how the keyboard coming up is a bad thing, and I won't be of any help to you since I don't have any experience with that sort of thing.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 02, 2015 0
Engaged ,
Nov 02, 2015

Copy link to clipboard

Copied

Hey Joe12south - I realise that in your case the issue is not related to a TextField - but adding one (hidden) and completing some of the strategies I mentioned (and then removing it) might still work .  That is, if trapping the event and preventing default behaviour doesn't work.  The trick will be adding the event listener as early as possible - before the softkeyboard is triggered.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 02, 2015 0
Community Beginner ,
Nov 02, 2015

Copy link to clipboard

Copied

kawikaheftel Correct, using an Android TV stick to drive digital signage. The AIR app is set as "home" so that it runs on launch, and always comes back.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 02, 2015 1
Community Beginner ,
Nov 02, 2015

Copy link to clipboard

Copied

Pea, thanks. Yeah, definitely going to give it a shot.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 02, 2015 0
Community Beginner ,
Nov 02, 2015

Copy link to clipboard

Copied

Thanks, I'll look into that link at my first opportunity.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 02, 2015 0
Community Beginner ,
Nov 03, 2015

Copy link to clipboard

Copied

Unfortunately, listening for soft keyboard events has no effect. They never fire in this instance. I think this can genuinely be classified as a bug.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 03, 2015 0
Engaged ,
Nov 09, 2015

Copy link to clipboard

Copied

unfortunately the SoftKeyboard support for Android is absolute garbage and to me is the best joke of AIR. Everytime I find someone having another softkeyboard issue it is somehow the opposite of every problem i've ever heard.

I posted this bug over 2 years ago....Adobe recognized it and refused to fix it... stating "just convert all your text field to stagetext" as the solution. (which as you know... people who have datagrids of editable text..... thats just the EASIEST solution)

Bug#3627285 - Textfield Bug on GPU with softkeyboard pan

Just this last week I've filled 2 new Android softkeyboard bugs

Bug#4085072 - Android softKeyboardRect Height is Incorrect

Bug#4085068 - Android softKeyboardBehavior "none" has no effect.

still waiting on Adobe to fix, until then chat applications are completely impractical.

Feature#3797220 - Soft keyboard maintain focus

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 09, 2015 0
New Here ,
May 24, 2016

Copy link to clipboard

Copied

Joe12south​ Did you find a solution to this?

I have the save problem, also for digital signage

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 24, 2016 0
Community Beginner ,
May 24, 2016

Copy link to clipboard

Copied

No, haven't found any way around it, and no response from Adobe.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 24, 2016 0
Adobe Employee ,
May 24, 2016

Copy link to clipboard

Copied

Hi,

Below piece of code can be used to maintain the focus of softkeyboard on Android:

private function mouseEventHandler(event:FocusEvent):void

  {

  if (event.type == FocusEvent.MOUSE_FOCUS_CHANGE)

  {

  event.preventDefault();

  }

Please use the attached sample project at below link:

Dropbox - StageTextFocusEventMouseFocusChange 

Please try this project at your end and share the result.

Below is the link for the fixed bug:

Feature#3797220 - Soft keyboard maintain focus - iOS & Android

Thanks,

Adobe AIR Team

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 24, 2016 0
New Here ,
May 25, 2016

Copy link to clipboard

Copied

@deesharm: That's not the same issue, this one is about the softkeyboard appearing every time the apps launches.

Joe12south​:

<activity android:windowSoftInputMode="stateHidden"...

Works for me, but my app is still unstable, not sure why

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 25, 2016 0
deesharm LATEST
Adobe Employee ,
May 25, 2016

Copy link to clipboard

Copied

Hi Jonas,

Do you see this bug with older builds as well like on AIR 18, AIR 19 or it's occurring with latest build only?

Could you please share a sample project to us so that we can reproduce the bug at our end?

Thanks,

Adobe AIR Team

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 25, 2016 0