应用程序流是这样;转到主屏幕
- 用户启动应用程序,看到一个页面,写有“后台任务启动”
- 如果用户点击后退按钮的应用程序终止,也后台任务结束
- 但如果用户点击菜单按钮,使用其他应用程序,然后我的应用程序继续运行
现在我有两种解决方案;请帮我解决这个问题。答:我应该有“OK”按钮;如果用户点击它,主菜单应该打开 B.在后退按钮中写什么,以便应用程序不终止。
In app.xaml
private static Geolocator locator;
public static Geolocator Locator
{
get
{
lock (typeof(App))
{
if (locator == null)
{
locator = new Geolocator();
locator.DesiredAccuracy = PositionAccuracy.High;
//locator.MovementThreshold = 50;
locator.ReportInterval = 10000;
}
}
return locator;
}
}
在MainPage.xaml.cs中
保护覆盖无效的OnNavigatedTo(NavigationEventArgs E) { App.Locator.PositionChanged + = Locator_PositionChanged; }
感谢
你需要给我们展示一些代码 –
你应该更具体地描述你的问题。现在,我可以告诉你,你可以覆盖“后退”按钮,但我不知道如何使用原生的“主页”按钮行为,即使有方法,应用程序也可能无法通过认证处理。 – Olter
只是告诉我如何创建主屏幕实例移动到家庭(瓷砖)屏幕上点击按钮! – user3102858