Skip to content
Draft
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,17 @@ public void BuildHasNoWarnings (bool isRelease, bool xamarinForms, bool multidex
proj.SetProperty ("XamarinAndroidSupportSkipVerifyVersions", "True"); // Disables API 29 warning in Xamarin.Build.Download
proj.SetProperty ("AndroidPackageFormat", packageFormat);
proj.SetProperty ("TrimmerSingleWarn", "false");

// Add test code for: https://github.com/dotnet/android/issues/10509
proj.MainActivity = proj.DefaultMainActivity.Replace ("//${AFTER_ONCREATE}",
"""
// These should not cause warnings
new FrameLayout (this).Foreground = null;
new ListView (this).Adapter = null;
Console.WriteLine (Android.Provider.MediaStore.Video.IVideoColumns.DateTaken);
Console.WriteLine (Android.Provider.MediaStore.Images.IImageColumns.DateTaken);
""");

using (var b = CreateApkBuilder ()) {
Assert.IsTrue (b.Build (proj), "Build should have succeeded.");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected override void OnCreate (Bundle savedInstanceState)
global::Xamarin.Forms.Forms.Init (this, savedInstanceState);
//${AFTER_FORMS_INIT}
LoadApplication (new App ());
//${AFTER_ONCREATE}
}
//${AFTER_ONCREATE}
}
}
Loading