Bug 2868 - Added contacts are not displayed on Contact Manager list in API 12 Emulator.
Summary: Added contacts are not displayed on Contact Manager list in API 12 Emulator.
Alias: None
Product: Android
Classification: Xamarin
Component: Samples ()
Version: 4.0
Hardware: Macintosh Mac OS
: High normal
Target Milestone: ---
Assignee: Atsushi Eno
Depends on:
Reported: 2012-01-12 11:54 UTC by Atin
Modified: 2013-06-27 03:45 UTC (History)
6 users (show)

Is this bug a regression?: ---
Last known good build:

This somehow needs to get fixed first...! (or find other way to debug this) (66.18 KB, image/png)
2013-06-18 04:14 UTC, Atsushi Eno

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:

Description Atin 2012-01-12 11:54:37 UTC
Steps to Reproduce:
1. Launch Mono Develop.
2. Download M4A sample applications from mono for android 4.0.2 branch.
3. Open Contact manager application.
4. Build and RUN it on API 12.
5. Add few contact in Emulator.
6. Open Contact Manager application in Emulator.
7. See added contact does not appear.

Actual result:
Added contacts are not displayed on Contact Manager list in API 12 Emulator.

Expected result:
Added contacts should display on Contact Manager list in API 12 Emulator.

Mono Develop 2.8.6 Beta
Mono for Android 4.0.3 Beta
Mono Framework 2.10.8 
Mac OSX 10.6 Snow Leopard
Windows 7
Comment 1 Eric Beisecker 2012-01-13 14:04:09 UTC
I see this same behavior in MfA 4.0.1 (Stable) so this is not a regression in 4.0.3
Comment 2 Timothy Risi 2013-05-29 16:13:48 UTC
The issue is related to the line:

String selection = string.Format ("{0} = '{1}'", ContactsContract.ContactsColumns.InVisibleGroup, show_invisible ? "0" : "1");

If selection is replaced with null in the ManagedQuery, contacts are displayed correctly, but the Show Invisible Contacts checkbox doesn't work (obviously).

return ManagedQuery (uri, projection, null, selectionArgs, sortOrder);

instead of:

return ManagedQuery (uri, projection, selection, selectionArgs, sortOrder);
Comment 3 Atsushi Eno 2013-06-18 04:14:41 UTC
Created attachment 4138 [details]
This somehow needs to get fixed first...! (or find other way to debug this)
Comment 4 Atsushi Eno 2013-06-18 04:15:44 UTC
The sshot didn't explain a lot - the Contact manager app crashes on emulator.
Comment 5 Atsushi Eno 2013-06-18 04:45:24 UTC
With all the explained steps, all what I could confirm was that the Contact manager just crashes on emulator. And thus the repro steps does not work. Actually I don't think it ever works for anyone else. Please provide any alternative way to reproduce this.

But what I think from comment #2 is that the application actually shows the contacts in whatever the actual code indicates (i.e. hidden ones won't show up when checked, and visible ones won't show up when unchecked), which means that's the expected behavior.
Comment 6 narayanp 2013-06-24 03:59:22 UTC
Today we have checked this issue with following builds:

X.S 4.0.9(build9)
Mono 2.10.12
Xamarin.Android 4.6.9

And we have changed the code as per Comment#2 and debug/run the application on API-12 Emulator but we are not seeing Contacts when check box is not checked. This is the screencast for the same:  http://screencast.com/t/EHJfHjWKI
Comment 7 Atsushi Eno 2013-06-27 03:45:49 UTC
OK, this is an UPSTREAM bug: the bug is in Android emulator.

First, after couple of attempts I could create an emulator by selecting "Nexus 10" and then downgrade the API Level to 12. It never got a working Contacts app that does not crash by selecting different device preset (those brand-less screensize-only).

Then I could launch Contacts app, create some contacts, and confirmed that the app did not show up the contacts I entered.

I suspected the emulator itself has the problem, so I launched Eclipse and created Android Sample project and selected Contact Manager sample, ran, and it resulted in the same empty list. So, the problem has nothing to do with Xamarin.

As I ran earlier, the app itself has no problem and shows contacts as expected.