2017년 5월 23일 화요일

Hide keybord after sending email


hope that everyone is ok ! :)
There is my issue, when i click a button it's oppening my mail client.
After i send my email, Gmail closed and i return to the app but the keybord stay open.
The only way I know to close it is to use the textbox.hidekeybord fonction.
But this will not work in that case.
Does anyone had ever have this issue ?
Do I miss something ?


--
There is also a Screen1.hidekeyboard method. Maybe that one works?
Otherwise there must be something in your code that makes it not execute the hideKeyboard.

--
Thx for your help.
I tried the Screen1.hidekeyboard but it doesn't work too.
Maybe i place it at the wrong place ?
Here is my code ? Do you see something wrong ?


--
sorry Wrong atachment
Here is the good one


--
the screenshot looks fine
after coming back into your app does the Screen1.HideKeyboard work manually using Do it?

--
It's not. Making a screen error :(

--
Error message :
" No focusable view found"
Any Idea ?


--
use one of the other mail solutions instead, for example the IFTTT solution

--
I can't be the sender. The user have to use his own mail client.
Otherwise it would have been à ggod solution.

--
Sharing component will be nice too, but I can't find a way to put the mail to in the code so the user don't have anything to do except clicking on Send.
The msg will contain previous value selected by the user, and be send to an mail adress (that I don't own).
Do you see any other way to do it ?

--
Seems the issue is that the mail client is bringing up the keyboard, so the mail client needs to make it go away ?

Will the smartphone hard/soft "Down" key make it go away? ( I recognise you want it to disappear "programatically") or will it not hide at all ?

Or is the keyboard up before you go to the mail client, in which case can you make it hide before the activitystarter?

--
Thx for your time.ble view found
As you can see on top, the message error was "No focusable view found".
So i just try to put a text box, also put a Screen1.hidekeyboard on GoBacktoMenu button.
It's working, when i click on it, it's hidding the keyboard.
BUT, what I would like is the keybord hide himself once the user sent his email, that way, when he come back to the app after sending his email, it's clean.
Do you have any Idea ?

--
As you can see on top, the message error was "No focusable view found".
you get that error, if you try to close the keyboard while there is no keyboard open
try Tim's suggestion and close the keyboard in the email app

--
Sounds like the keyboard is open in the app before ActivityStarter, so close it before "leaving" the app to go to the email client ?

--
what do you mean by " close the keyboard un thé email app" ? How Can I get client mail to close the keyboard automaticaly ?

--
keyboard is not previously open in the app. The user never use the keyboard except for this email part.

--
Does the problem occur in the Companion and the built app?

--
Both oh them

--
Well, I found a workaround.


1/ The fonction Screen1.HideKeyboard need a focusable view to close the KeyBoard, so don't forget to put a TextBox on your screen with Heigth & Width to 1 Px.
2/ I used a clock with timer set up to 5 ms. When the user click on the SendEmail button, it's trigger the timer to close the keyboard every 5 Ms.
3/ When the keyboard is hidden, you have to set up a trigger to set TimerEnabled to false. For that, I use WhenSceenError with code error 906.

It's maybe not pretty, but it's working ! :) 



--
Is there an extrakey or extravalue that can be sent to the mailapp to stop it opening the keyboard?

Or what "result" is generated by the mailapp on return to appinventor ?

--
Well done Jules

--
Hummmm I maybe spoke to fast.
It's not working the first time i click the Mail button. Back button allow me to hide the keyboard, if I click again on mail button, this time it's working.
Any idea why ?
@ Taifun: a simple extrakey to send to the mail app will be nice. Any idea ?

--
This should be registered as a bug, or at least something to be fixed by the MIT Developers

If you just use the Gmail app on its own, the keyboard disappears once you send a message, and retrnes to list of emails, but not so if accessed via ActivityStarter

--

댓글 1개:

  1. As I understand it, this is a known AI2 issue. It seems to have nothing to do specifically with the mail app, as demonstrated here: https://groups.google.com/forum/#!msg/mitappinventortest/AJpSbvOjCXo/WlZBG9YgDgAJ

    답글삭제