android毕设外文资料和译文内容摘要:

the user moves from activity to activity, across applications, the Android system keeps a linear navigation history of activities the user has visited. This is the activity stack, also known as the back stack. In general, when a user starts a new activity, it is added to the activity stack, so that pressing BACK displays the previous activity on the stack. However, the user cannot use the BACK key to go back further than the last visit to Home. The adding of an activity to the current stack happens whether or not that activity begins a new task (as long as that task was started without going Home), so going back can let the user go back to activities in previous tasks. The user can get to tasks earlier than the most recent Home by selecting its root activity from the application launcher, a shortcut, or the Recent tasks screen. Activities are the only things that can be added to the activity stack — views, windows, menus, and dialogs cannot. That is, when designing the navigation, if you have screen A and you want the user to be able go to a subsequent screen B and then use the BACK key to go back to screen A, then the screen A needs to be implemented as an activity. The one exception to this rule is if your application takes control of the BACK key and manages the navigation itself. 东北大学 东软信息学院毕业设计(论文) 译文 8 Tasks A task is the sequence of activities the user follows to acplish an objective, regardless of which applications the activities belong to. Until a new task is explicitly specified (see Interrupting the Task), all activities the user starts are considered to be part of the current task. It39。 s notable that these activities can be in any application — that is, all in the same application or in different ones. That is, a task that starts out in contacts can continue, by choosing an address, to an activity and then, by attaching a file, to a picture gallery to pick from. Contacts, and picture gallery are all separate applications. The activity that starts a task is called the root activity. It is often, but not necessarily, started from the application launcher, Home screen shortcut or Recent tasks switcher (a long press on Home on some devices). The user can return to a task by choosing the icon for its root activity the same way they started the task. Once inside a task, the BACK key goes to previous activities in that task. The activity stack is made up of one or more tasks. Here are some examples of tasks: Send a text message with an attachment View a YouTube video and share it by with someone else Interrupting the Task An important property of a task is that the user can interrupt what they39。 re doing (their task) to perform a different task, then are able to return to where they left off to plete the original task. The idea is that users can run multiple tasks simultaneously and switch between them. There are two primary ways to jump off to that other task — in both cases the user should be able to return to where they were before the interruption: User is interrupted by a notification – a notification appears and the user wants to act on it User deciding to perform another task – user just presses Home and starts an application Of course, there are exceptions to the rules. Beyond the two ways just mentioned, there is a third way to start a task, and that is by starting an activity that defines itself as a new task. Maps and Browser are two applications that do this. For example, choosing an address in an starts the Maps activity as a new task, and choosing a link in an starts the Browser activity as a new task. In these cases, the BACK key will return to the previous activity in a different task (Email), because it was not started from Home. 东北大学 东软信息学院毕业设计(论文) 译文 9 A Tour of Activities and Tasks The following examples illustrate basic principles for applications, activities, the activity stack, the BACK key, tasks and intents. It shows how the system responds to user actions such as starting activities and switching between tasks. With most of these examples you can follow along, launching activities on your device as indicated. Starting an Activity from Home Home is the starting place for most applications. (Some applications can be launched only from other applications.) When the user touches an icon in the application launcher (or a shortcut on the Home screen), the main activity for that application is launched into the foreground where it has user focus. Navigating Away from an Activity with BACK and HOME keys An activity can keep or lose its state depending on how the user leaves the activity — by the HOME or BACK key. By default, pressing the BACK key finishes (destroys) the current activity and displays the previous activity to the user. In addition, not all activities have the behavior that they are destroyed when BACK is pressed. When the user starts playing music in the Music application and then presses BACK, the application overrides the normal back behavior, preventing the player activity from being destroyed, and continues playing music, even though its activity is no longer visible — as a visual substitute, the Music application places a notification in the status bar so the user still has an easy way to get to the application to stop or control the music. Note that you can write an activity to stop when its screen is no longer visible, or to continue running in the background — the latter was chosen for the music player. Reusing an Activity When activity A starts activity B in a different application, activity B is said to be reused. This use case normally takes。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。