lập trình android (phần 8)

Tham khảo tài liệu 'lập trình android (phần 8)', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 326 Chapter 12 Putting it all together-the Field Service Application More on Bundles We need to pass the selected job to the ShowJob Activity but we cannot casually pass an object from one Activity to another. We don t want the ShowJob Activity to have to parse the list of jobs again otherwise we could simply pass back an index to the selected job by using the integer storage methods of a Bundle. Perhaps we could store the currently selected JobEntry and JobList for that matter in a global data member of the Application object should we have chosen to implement one. If you recall in chapter 1 when we discussed the ability of Android to dispatch Intents to any Activity registered on the device we want to keep the ability open to an application other than our own to perhaps pass a job to us. If that were the case using a global data member of an Application object would never work Never mind for the moment the likelihood of such a step being low particularly considering how the data is stored in this application. This chapter s sample application is an exercise of evaluating some different mechanisms one might employ to solve data movement around Android. The chosen solution is to package the data fields of the JobEntry in a Bundle O in listing to move a JobEntry from one Activity to another. In the strictest sense we are moving not a real JobEntry object but a representation of a JobEntry s data members. The net of this long discussion is that this method creates a new Bundle by using the toBundle method of the JobEntry. capable device and toolbox. To help in the discussion of the different features available to the user on this screen take a look at figure . The layout is very straightforward but this time we have some Buttons and we will be changing the textual description depending on the condition of a particular job s status. A TextView is used to present job details such as address product requiring service and comments. The third Button will have .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.