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 */
    }
}
arrow
arrow
    文章標籤
    Android broastcast receiver
    全站熱搜

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