1.Declare intent name in Manifest file:

<action android:name="com.yourdomain.youapp.SETTING_UPDATE" />

2.Define intent name:

public static final String SETTING_UPDATE = "com.yourdomain.youapp.SETTING_UPDATE";

3.Handle in onReceive:

@Override
public void onReceive(Context context, Intent intent) {
    super.onReceive(context, intent);
    String strAction = intent.getAction();
    if (SETTING_UPDATE.equals(strAction)) {
        /* Do update setting */
    }
}
文章標籤
創作者介紹

呆子獅的夢想世界

lionlionchopper 發表在 痞客邦 PIXNET 留言(0) 人氣()