Bug 16384 - Constructor not being called
Summary: Constructor not being called
Status: RESOLVED DUPLICATE of bug 16377
Alias: None
Product: Android
Classification: Xamarin
Component: Mono runtime / AOT Compiler ()
Version: 4.10.1
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2013-11-21 08:25 UTC by Tomas
Modified: 2013-12-11 05:38 UTC (History)
4 users (show)

Tags:
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:
Status:
RESOLVED DUPLICATE of bug 16377

Description Tomas 2013-11-21 08:25:10 UTC
After the 4.10.x update there seems to be a problem with Java Activation (as described here http://docs.xamarin.com/guides/android/advanced_topics/architecture/#4.1.java-activation)

Specifically, event #11, the other constructor is not being executed.

Sample code:
public abstract class DeviceWidget : RelativeLayout
{
	public DeviceWidget(Context context) : base (context)
	{
		InitDeviceWidget();
	}

	public DeviceWidget(Context context, IAttributeSet attrs) : base (context, attrs)
	{
		InitDeviceWidget();
	}

	public DeviceWidget(Context context, IAttributeSet attrs, int defStyle) : base (context, attrs, defStyle)
	{
		InitDeviceWidget();
	}

	protected DeviceWidget(IntPtr handle, JniHandleOwnership owner) : base(handle, owner)
	{
	}

	private void InitDeviceWidget()
	{
		// This is never called
	}

	protected override int[] OnCreateDrawableState(int extraSpace)
	{
		// This method is the reason we need to define the protected constructor
	}
}
Comment 1 Jonathan Pryor 2013-11-22 12:00:46 UTC

*** This bug has been marked as a duplicate of bug 16377 ***