后退按钮无法正常运行 [英] Back button not functioning properly

查看:78
本文介绍了后退按钮无法正常运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用C#在 windows mobile 6上开发项目.
在此应用程序中,我们有一些屏幕.用户可以浏览这些屏幕(窗体).
我们在每个表单的菜单中都提供了后退按钮功能,即,如果用户从当前表单转到下一个表单,则可以向他提供返回上一屏幕的选项.
当用户处于该应用程序环境中时,此方法工作正常,,但是每当用户按下电话上提供的结束按钮并返回到我们的应用程序时,他都可以看到他离开的屏幕,但是当他单击返回选项时,该应用程序正在消失.
再次,当他打开应用程序时,将看到用户期望的屏幕.
这种情况一直发生,直到用户看到应用程序的初始屏幕为止.

谁能帮我解决这个问题.

谢谢
Yashwanth.

Hi all,

Am working on a project on windows mobile 6 using C#.
In this application we have some screens. The user can navigate through these screens(forms).
We provided a back button functionality in each form''s menu i.e if the user go to next form from the current form he is provided with a option to come back to previous screen.
This is working fine when the user is within that application environment, but whenever the user presses the end button provided on phone and comes back to our application he can seen the screen where he left at but when he clicks back option the application is getting disappeared.
Again when he opens the application the user is seen expected screen.
And this is happening until the user sees the initial screen of the application.

Can any one help me in solving this problem.

Thank You
Yashwanth.

推荐答案

因此,在应用程序启动时,将显示最后访问的屏幕.那是故意的.对吧?

按下返回"按钮可使申请消失.让我解释为应用程序崩溃而没有错误消息".

该应用程序可能会崩溃,因为它尝试使用设置为null的变量的值.

按下返回"按钮将确保使用某些变量lastVisitedPage或类似名称.它可能是Form12345类型.将通过转到下一页进行设置.但是尚未设置.

在单击按钮使用它之前,请检查它是否不同于null.
So on application start, the last visited screen is shown. That is by intention. Right?

Pressing the "Back" button makes the applicaiton disappear. Let me interpret that as "application crashes without error message".

The application may crash because it tries to use a variable''s value that is set to null.

Pressing the "Back" button will for sure use some variable lastVisitedPage or something similar. It may be of type Form12345. It will be set by going to the next page. But it is not set yet.

Check if it is different from null before you use it on button click.


您需要此信息,无论是在填写完所有表格之后,还是在应用程序结束并重新启动时.

1.制作一个将在您进入下一个屏幕或应用程序结束时调用的函数.此功能应保存在表单中输入的数据.不知道如何在移动平台上进行操作,但是我想XML文件是最简单的.那是我的专长.将数据持久保存到文件或数据库中,不要将其保留在内存中.

2.每当您返回时,都从文件(或数据库)中加载数据.每当应用启动时,当前选项卡都应从文件(或数据库)中加载数据.

现在,您可以返回或退出应用程序,而不会丢失宝贵的数据,也不会崩溃(如果正确实现了此功能).由于我不是移动开发方面的杰出专家(大约3年前),因此我将把实施工作留给您. :)
You need this information, both after all the forms are filled out or when the application is ended and restarted.

1. Make a function that will be called whenever you go to a next screen or when the application ends. This function should save the data that is entered in the forms. Not sure how you do it on the mobile platform, but I suppose an XML file would be easiest. That''s my expertise talking. Persist the data to a file or database, don''t keep it in memory.

2. Whenever you go back, load the data from the file (or database). Whenever the app starts, the current tab should load the data from the file (or database).

Now you can go back or you can exit the app, without loosing precious data and without crashing (if you implement this correctly). Since I''m no great expert on mobile development (did some 3 years ago), I''ll leave the implementation up to you. :)


这篇关于后退按钮无法正常运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆