tailieunhanh - Giáo trình hình thành ứng dụng tícch hợp cài đặt Androi với Eclipse p4

Tham khảo tài liệu 'giáo trình hình thành ứng dụng tícch hợp cài đặt androi với eclipse p4', công nghệ thông tin, hệ điều hành phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Hướng dẫn lập trình CO bẩn với Android Part 15 B6 Tạo Broadcast Receiver để nhận Intent mà Activity2 gửi tới - Tạo 1 file trong - Nội dung Mã package import import import import public class Receiver extends BroadcastReceiver @Override public void onReceive Context context Intent intent long value new value -10 10 Toast toast context Broadcast Receiver catch an Intent n The value is stored in the Intent is value Code không hề khó hiểu và mình cũng đã add comment. Chỉ cần lưu ý ở đây là Toast là lớp để hiển thị một thông báo đơn giản trong 1 khoảng thời gian cố định và ko thể thay đổi thời gian này T_T why chỉ có thể chọn giữa LENGTH_sHoRT với LENGTH_LONG B7 Bổ sung thêm thông tin về component mới vào Mã xml version encoding utf-8 manifest xmlns android http apk res andro id package android versionCode 1 android versionName application android icon @drawable icon android label @string app_name activity android name .Activity1 android label @string app_name intent-filter action android name category android name intent-filter activity activity android name .Activity2 activity receiver android name .Receiver receiver application uses-sdk android minSdkVersion 3 manifest Sffie 1 11 PM Explicit Intent Example Activity 1 - Send .

TỪ KHÓA LIÊN QUAN