Bug 14136 - ShareActionProviderDemo Sample: Two "Share Picture" options appears on clicking Menu button after changing app target framework.
Summary: ShareActionProviderDemo Sample: Two "Share Picture" options appears on clicki...
Alias: None
Product: Android
Classification: Xamarin
Component: Samples ()
Version: 4.8.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Oleg Demchenko
Depends on:
Reported: 2013-08-21 08:05 UTC by Saurabh
Modified: 2013-10-03 10:26 UTC (History)
2 users (show)

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

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 Saurabh 2013-08-21 08:05:36 UTC
Step to reproduce:
1. Open ShareActionProviderDemo android sample
2. Open application Option
3. Select Target Framework to 'Android 4.2(Jelly Bean)' 
4. Select Minimum Android version to 'Android 2.2(API level 8)' 
5. Deploy the application on emulator
6. Application deploys successfully
7. Click on Menu button of the emulator

Actual result:
On clicking Menu button of the emulator two "Share Picture" options appears on the screen. However, if we deploy application with its default setting then single "Share Picture" options appears on clicking Menu button of the emulator.

Note: This issue exists on both emulator as well as device.

Expected result:
On clicking Menu button of the emulator single "Share Picture" options should appear after changing its option similar as it appears with its default settings.

Screencast: http://screencast.com/t/ayNLO64ngBx

Environment details:
Mac Loin, ML and Mavericks
X.S 4.0.11(build 7)
Mono 3.2.2
X.Android 4.8.2-54

App info:
monodroid-sample-master- 5d63590ee1db0e221a45426f8bf8be3b7328535c

Regression status: This issue also exist with stable mono-android-4.8.0-13-2.
Comment 1 Peter Collins 2013-08-21 12:56:54 UTC
In general, the "Target Framework" set for existing monodroid-samples acts as a Minimum Framework (as the minimum defaults to the target). This sample requires 4.0 to build, therefore reducing the Minimum Android Version to v2.2 (API 8) is an invalid test-case.

As a good sanity check, attempt to build with the 'Target Framework' also set to the 'Minimum Framework' you are testing. If the build fails, the 'Minimum Framework' being tested is invalid.
Comment 2 PJ 2013-08-21 15:26:51 UTC
The minimum should be set for all samples, as we need to test against multiple target frameworks. 

In general, an android application should be set to the latest target framework it has been tested against. This does not mean that it can't be run on lower devices. Apps can use lower API than their target framework, or they can wrap calls to new API with conditional directives.

This sample does not have a minimumSdkVersion set, so we should set if if needed. Also, I'm not sure this has anything to do with the double menu items.
Comment 3 Oleg Demchenko 2013-10-02 14:45:42 UTC
Removed duplicate "Share Picture" buttons
Fix commit: c1f94452a839ffe0bdb17cf36e0c5f89cd297830
Comment 4 narayanp 2013-10-03 10:26:48 UTC
Today I have checked this issue with following builds:

All Mac
X.Android 4.8.3
X.S 4.0.12(build 3)
Mono 3.2.3

latest monodroid-sample/Shared Action Provider demo

Now we are getting only one Share Picture button after clicking on Menu button from Emulator when target framework is set to 4.2 and minimum android version is set to 2.2. This is the screencast for the same: http://screencast.com/t/hsO4x1506rYR

Changing the status to Verified.