TAILIEUCHUNG - Beginning Android PHẦN 8

Java API truyền thống không tồn tại trong Dalvik-ví dụ, có thể có các công cụ ẩn bên trong BeanShell hoặc tiện ích lọ mà không làm việc trên Android hiện nay. Thứ hai, ngôn ngữ kịch bản mà không JIT chắc chắn sẽ chậm hơn so với biên soạn các ứng dụng Dalvik. Chậm hơn có thể có nghĩa là trì trệ kinh nghiệm người dùng. | 244 CHAPTER 26 HANDLING ROTATION The third possibility for handling rotations therefore is to tell Android that you will handle them completely yourself and that you do not want assistance from the framework. To do this 1. Put an android configChanges entry in your file listing the configuration changes you want to handle yourself versus allowing Android to handle for you. 2. Implement onConfigurationChanged in your Activity which will be called when one of the configuration changes you listed in android configChanges occurs. Now for any configuration change you want you can bypass the whole activity-destruction process and simply get a callback letting you know of the change. To see this in action turn to the Rotation RotationThree sample application. Once again our layouts are the same so the application looks the same as the preceding two samples. However the Java code is significantly different because we are no longer concerned with saving our state but rather with updating our UI to deal with the layout. But first we need to make a small change to our manifest xml version encoding utf-8 manifest xmlns android http apk res android package android versionCode 1 android versionName application android label @string app_name activity android name .RotationThreeDemo android label @string app_name android configChanges keyboardHidden orientation intent-filter action android name category android name intent-filter activity application manifest Here we state that we will handle keyboardHidden and orientation configuration changes ourselves. This covers us for any cause of the rotation whether it is a sliding keyboard or a physical rotation. Note that this is set on the activity not the application if you have several activities you will need to decide for each which of the tactics outlined in this chapter you wish to .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.