Android初学第94天

Android初学第94天

29_BroadcastIntents

代码

PhotoGallery

StartupReceiver.java

package com.bignerdranch.android.photogallery;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class StartupReceiver extends BroadcastReceiver{
    private static final String TAG = "StartupReceiver";

    @Override
    public void onReceive(Context context, Intent intent) {
        Log.i(TAG, "Received broadcast intent: " + intent.getAction());

        boolean isOn = QueryPreferences.isAlarmOn(context);
        PollService.setServiceAlarm(context, isOn);
    }

}

posted @ 2018-06-22 19:17  HankZhou  阅读(59)  评论(0编辑  收藏  举报