Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 13103 [details]
Test project that exhibits described behaviour
Pressing enter key when EditView field has focus dispatches its EditorAction event twice. I don't know if this is by design but it looks like event is dispatched on key down and key up. And that can lead to unexpected behaviour of the application when testing.
I've attached a test project. Steps to reproduce:
* Run project in Xamarin Android Player.
* Click on the edit field in the activity and press enter key.
* Console.WriteLine is called twice. I expect it to be called only once.
My Xamarin version:
Version 5.9.6 (build 23)
Installation UUID: 59a6b98a-f16f-4f0a-9aa9-e5192209be89
Microsoft .NET 4.0.30319.34209
GTK+ 2.24.22 (MS-Windows theme)
Android SDK: [...]
Supported Android versions:
4.0.3 (API level 15)
4.1 (API level 16)
4.4 (API level 19)
5.0 (API level 21)
Java SDK: [...]
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) Client VM (build 25.60-b23, mixed mode)
Xamarin Android Player
Release ID: 509060023
Git revision: ffb99e7bbfddb36e10b6162f94eeb3166332d5a5
Build date: 2015-08-27 09:59:33-04
Xamarin addins: e92e5fe27863d5c4748872fa55e0fdbe09d27856
I can see the same behaviour when using Google's Android emulator. This does not look to be an issue with Xamarin Android Player and so I'm going to move this bug.
This appears to be By Design™:
I suspect that KeyEvent.Action will return KeyEventActions.Down and KeyEventActions.Up.