Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,13 @@ void GenerateHeader (StreamWriter sw)

void GenerateBody (StreamWriter sw)
{
foreach (Signature ctor in ctors)
foreach (Signature ctor in ctors) {
if (string.IsNullOrEmpty (ctor.Params) && JniType.IsApplication (type))
continue;
GenerateConstructor (ctor, sw);
}

GenerateApplicationConstructor (sw);

foreach (JavaFieldInfo field in exported_fields)
GenerateExportedField (field, sw);
Expand Down Expand Up @@ -755,6 +760,19 @@ void GenerateConstructor (Signature ctor, StreamWriter sw)
sw.WriteLine ("\t}");
}

void GenerateApplicationConstructor (StreamWriter sw)
{
if (!JniType.IsApplication (type)) {
return;
}

sw.WriteLine ();
sw.WriteLine ("\tpublic {0} ()", name);
sw.WriteLine ("\t{");
sw.WriteLine ("\t\tmono.MonoPackageManager.setContext (this);");
sw.WriteLine ("\t}");
}

void GenerateExportedField (JavaFieldInfo field, StreamWriter sw)
{
sw.WriteLine ();
Expand Down