我在使用xamarin表單的時候,當我在主頁上的時候出現了andorid,並且我從錯誤'未處理的異常發生後點擊了它。不遵循應用生命週期OnBackPressed()xamarin表單中的錯誤
我試圖做這種方式,沒有結果至今(OnBackPressed)
[Activity(Label = "teste", Icon = "@drawable/icon", Theme = "@style/MainTheme", NoHistory = true, MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
protected override void OnCreate(Bundle bundle)
{
TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;
base.OnCreate(bundle);
global::Xamarin.Forms.Forms.Init(this, bundle);
LoadApplication(new App());
}
bool formOpen = false;
void OnBackPressed(Bundle bundle)
{
if (formOpen == false)
{
base.OnBackPressed();
}
else
{
}
}
}
無論哪種方式,它給人的錯誤時,返回 –
它崩潰中的其他和發生錯誤,我認爲它不允許在後臺 –
應用這種情況發生時,我 –