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 9305 [details]
Connecting a bluetooth keyboard to the android device while the Forms app is running will cause the navigation to reset to the root.
**Steps to Reproduce:**
1. Open the attached sample.
2. Run it on an Android Device (I used a Nexus 5 with API 21, turn on Bluetooth on the device)
3. Pair a bluetooth keyboard with your device.
4 Switch back to the running app.
5. Press Go to Page Two (Keep doing this until you are at Page 4)
6. Turn off your paired keyboard.
7. Turn it back on, and it should auto-connect back to your device.
When the keyboard auto-connects to the device in step 7 above, the navigation hierarchy in the app resets to the Page One.
The app should stay on Page Four.
**Build Date & Platform:**
I was able to reproduce this using my Apple wireless keyboard and my Nexus 5.
I have tried this issue and able to reproduce the reported behavior at my end.
Steps to Reproduce:
1. Open the attached sample.
2. Run it on an Android Device.
3. Pair a Bluetooth Keyboard with the device.
4. Switch back to the running application.
5. Press Go to Page Two, keep on pressing the button until you reach the last page.
6. Turn off the paired keyboard.
7. Turn it back on, Bluetooth keyboard auto connect back to the device.
8. It should stay on page four but it reset to page One.
Device Log: https://gist.github.com/Abhishekk360/e597338aecbaeadbcca1
=== Xamarin Studio ===
Version 5.7 (build 661)
Installation UUID: 93e693b0-b53d-40f4-b29c-b61ff5cbe892
Mono 3.12.0 ((detached/a813491)
GTK+ 2.24.23 (Raleigh theme)
Package version: 312000068
=== Apple Developer Tools ===
Xcode 6.1 (6604)
=== Xamarin.iOS ===
Version: 22.214.171.124 (Business Edition)
Build date: 2015-01-08 22:29:16-0500
=== Xamarin.Android ===
Version: 126.96.36.199 (Business Edition)
Android SDK: /Users/xamarin23/Desktop/android-sdk-macosx
Supported Android versions:
2.1 (API level 7)
2.2 (API level 8)
2.3 (API level 10)
3.1 (API level 12)
4.0 (API level 14)
4.0.3 (API level 15)
4.1 (API level 16)
4.2 (API level 17)
4.3 (API level 18)
4.4 (API level 19)
4.4.87 (API level 20)
5.0 (API level 21)
Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
=== Xamarin.Mac ===
Version: 188.8.131.52 (Business Edition)
=== Build Information ===
Release ID: 507000661
Git revision: b70bab61da996da29045ea8ee8aed1a6faedbe78
Build date: 2015-01-05 16:31:31-05
Xamarin addins: 82f6c71490562d6cd125a09287f441902fdac3d7
=== Operating System ===
Mac OS X 10.10.0
Darwin 800BC.local 14.0.0 Darwin Kernel Version 14.0.0
Fri Sep 19 00:26:44 PDT 2014
Created attachment 9387 [details]
Non-Forms test case
Added a Non-Xamarin.Forms test case that _does not_ reproduce the same issue. This hopefully points to the issue being with Xamarin.Forms.
Can you please try setting the ConfigChanges.Keyboard bit on your activity? I am unfortunately having a heck of a time getting an android device to pair with any of hte BT keyboards I have.
A customer has informed me that adding ConfigChanges.Keyboard on the Activity does not help in this case nor the sample case above. I'm reopening this bug until further notice. Please let me know if we need anything else and I'll be happy to provide it.
Hi, unfortunately despite the status this is still not fixed in XF 184.108.40.20692.
The attached test case is still reproducing this issue.
Please review this, it causes a lot of issues for our customers.
This appears to still be occurring in Forms 2.1.x using the attached test case
I confirmed bad behavior on 2.3.4 and 2.3.5-pre.
This is fixed in master. Tested on nightly build 220.127.116.11-nightly
Apologies, wrong ticket opened in my browser! Ignore that previous comment.
For sanity's sake, I pulled all the Shared project files into a File->New->Cross-Platform (Shared) solution and updated to the latest Forms stable package: v18.104.22.168. That version exhibited the same restart when a Bluetooth keyboard was connected or disconnected.
I also updated the latest pre-release package, v22.214.171.124-pre3, and confirmed the restart there as well.
After some discussion, this is actually a standard feature of Android. Device configurations can often cause Android to restart the running Activity, and adding/removing a keyboard is one such configuration change. Activities can tell the OS that they want to handle these changes themselves to avoid that restart.
The default Xamarin.Forms templates are specifically wired up in the Android project to handle the basics of screen size and orientation changes, but you can also decide to add keyboard-related values to prevent these restarts.
In your Android head project, open MainActivity.cs and alter the ConfigurationChanges value in the Activity attribute on the class to include ConfigChanges.Keyboard and ConfigChanges.KeyboardHidden.
[Activity (..., ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden)]
It's probably worth some discussion as to whether this should become part of the File->New templates or not for projects going forward, though.
*** Bug 31383 has been marked as a duplicate of this bug. ***