I'm using xamarin forms where in andorid when I'm on the main page and I click on it back from the error 'An unhandled exception occured.' Does not follow the app lifecycle
I'm trying to do it this way, no results so far ( OnBackPressed )
def func(d):
d_arr = []
for rN in d:
d_arr.extend(np.random.uniform(rN[0], rN[1], rN[2]))
return np.asarray(d_arr)
d = [[0.01, 0.11, 3413], [0.11, 0.21000000000000002, 1305], [0.21000000000000002, 0.31000000000000005, 675], [0.31000000000000005, 0.41000000000000003, 439], [0.41000000000000003, 0.51000000000000012, 318], [0.51000000000000012, 0.6100000000000001, 221], [0.6100000000000001, 0.71000000000000008, 151], [0.71000000000000008, 0.81000000000000016, 109], [0.81000000000000016, 0.91000000000000014, 82], [0.91000000000000014, 1.0100000000000002, 64], [1.0100000000000002, 1.1100000000000003, 51], [1.1100000000000003, 1.2100000000000004, 41], [1.2100000000000004, 1.3100000000000003, 34], [1.3100000000000003, 1.4100000000000004, 28], [1.4100000000000004, 1.5100000000000005, 24], [1.5100000000000005, 1.6100000000000003, 21], [1.6100000000000003, 1.7100000000000004, 18], [1.7100000000000004, 1.8100000000000005, 16], [1.8100000000000005, 1.9100000000000004, 14], [1.9100000000000004, 2.0100000000000002, 12], [2.0100000000000002, 2.1100000000000003, 11], [2.1100000000000003, 2.2100000000000004, 10], [2.2100000000000004, 2.3100000000000005, 9], [2.3100000000000005, 2.4100000000000001, 8], [2.4100000000000001, 2.5100000000000002, 7], [2.5100000000000002, 2.6100000000000003, 7], [2.6100000000000003, 2.7100000000000004, 6], [2.7100000000000004, 2.8100000000000005, 6], [2.8100000000000005, 2.9100000000000006, 5], [2.9100000000000006, 3.0100000000000002, 5], [3.0100000000000002, 3.1100000000000003, 4], [3.1100000000000003, 3.2100000000000004, 4], [3.2100000000000004, 3.3100000000000005, 4], [3.3100000000000005, 3.4100000000000006, 4], [3.4100000000000006, 3.5100000000000007, 3], [3.5100000000000007, 3.6100000000000008, 3], [3.6100000000000008, 3.7100000000000004, 3], [3.7100000000000004, 3.8100000000000005, 3], [3.8100000000000005, 3.9100000000000006, 3], [3.9100000000000006, 4.0100000000000007, 2], [4.0100000000000007, 4.1100000000000012, 2], [4.1100000000000012, 4.2100000000000009, 2], [4.2100000000000009, 4.3100000000000014, 2], [4.3100000000000014, 4.410000000000001, 2], [4.410000000000001, 4.5100000000000016, 2], [4.5100000000000016, 4.6100000000000012, 2], [4.6100000000000012, 4.7100000000000009, 2], [4.7100000000000009, 4.8100000000000014, 2], [4.8100000000000014, 4.910000000000001, 2], [4.910000000000001, 5.0100000000000016, 1], [5.0100000000000016, 5.1100000000000012, 1], [5.1100000000000012, 5.2100000000000017, 1], [5.2100000000000017, 5.3100000000000014, 1], [5.3100000000000014, 5.410000000000001, 1], [5.410000000000001, 5.5100000000000016, 1], [5.5100000000000016, 5.6100000000000012, 1], [5.6100000000000012, 5.7100000000000017, 1], [5.7100000000000017, 5.8100000000000014, 1], [5.8100000000000014, 6.0100000000000016, 2], [6.0100000000000016, 6.2100000000000017, 2], [6.2100000000000017, 6.4100000000000019, 2], [6.4100000000000019, 6.6100000000000012, 2], [6.6100000000000012, 6.8100000000000014, 1], [6.8100000000000014, 7.0100000000000016, 1], [7.0100000000000016, 7.2100000000000017, 1], [7.2100000000000017, 7.4100000000000019, 1], [7.4100000000000019, 7.6100000000000021, 1], [7.6100000000000021, 7.8100000000000014, 1], [7.8100000000000014, 8.1100000000000012, 1], [8.1100000000000012, 8.4100000000000019, 1], [8.4100000000000019, 8.7100000000000009, 1], [8.7100000000000009, 9.0100000000000016, 1], [9.0100000000000016, 9.3100000000000005, 1], [9.3100000000000005, 9.7100000000000009, 1], [9.7100000000000009, 10.110000000000001, 1], [10.110000000000001, 10.510000000000002, 1], [10.510000000000002, 11.010000000000002, 1], [11.010000000000002, 11.510000000000002, 1], [11.510000000000002, 12.110000000000001, 1], [12.110000000000001, 12.710000000000003, 1], [12.710000000000003, 13.410000000000002, 1], [13.410000000000002, 14.210000000000003, 1], [14.210000000000003, 15.110000000000003, 1], [15.110000000000003, 16.110000000000003, 1], [16.110000000000003, 17.310000000000002, 1], [17.310000000000002, 18.710000000000004, 1], [18.710000000000004, 20.410000000000004, 1], [20.410000000000004, 22.410000000000004, 1], [22.410000000000004, 24.910000000000004, 1], [24.910000000000004, 28.210000000000004, 1], [28.210000000000004, 32.710000000000008, 1], [32.710000000000008, 39.210000000000008, 1], [39.210000000000008, 49.710000000000008, 1], [49.710000000000008, 70.210000000000008, 1], [70.210000000000008, 133.41000000000005, 1]]
for _ in range(10000):
d_arr = func(d)
答案 0 :(得分:0)
OnBackPressed
应标记为override
,且为public
:
public override void OnBackPressed()
{
if (!formOpen)
base.OnBackPressed();
else
{
}
}
答案 1 :(得分:0)
使用以下
protected override bool OnBackButtonPressed()
{
return base.OnBackButtonPressed();
}
在Xamarin表单页面中,而不是在android活动中。