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 */
}
}
留言列表