public override void onReceive(android.content.Context context, android.content.Intent intent) { if (intent.getAction().Equals(android.content.Intent.ACTION_TIMEZONE_CHANGED)) { string tz = intent.getStringExtra("time-zone"); this._enclosing.mCalendar = new android.text.format.Time(java.util.TimeZone.getTimeZone (tz).getID()); } this._enclosing.onTimeChanged(); this._enclosing.invalidate(); }
public override void onReceive(android.content.Context context, android.content.Intent intent) { // BEGIN_INCLUDE(onReceive) // Protect against rogue update broadcasts (not really a security issue, // just filter bad broacasts out so subclasses are less likely to crash). string action = intent.getAction(); if (android.appwidget.AppWidgetManager.ACTION_APPWIDGET_UPDATE.Equals(action)) { android.os.Bundle extras = intent.getExtras(); if (extras != null) { int[] appWidgetIds = extras.getIntArray(android.appwidget.AppWidgetManager.EXTRA_APPWIDGET_IDS ); if (appWidgetIds != null && appWidgetIds.Length > 0) { this.onUpdate(context, android.appwidget.AppWidgetManager.getInstance(context), appWidgetIds ); } } } else { if (android.appwidget.AppWidgetManager.ACTION_APPWIDGET_DELETED.Equals(action)) { android.os.Bundle extras = intent.getExtras(); if (extras != null && extras.containsKey(android.appwidget.AppWidgetManager.EXTRA_APPWIDGET_ID )) { int appWidgetId = extras.getInt(android.appwidget.AppWidgetManager.EXTRA_APPWIDGET_ID ); this.onDeleted(context, new int[] { appWidgetId }); } } else { if (android.appwidget.AppWidgetManager.ACTION_APPWIDGET_ENABLED.Equals(action)) { this.onEnabled(context); } else { if (android.appwidget.AppWidgetManager.ACTION_APPWIDGET_DISABLED.Equals(action)) { this.onDisabled(context); } } } } }
public override void onReceive(android.content.Context context, android.content.Intent intent) { string action = intent.getAction(); if (android.content.Intent.ACTION_SCREEN_OFF.Equals(action)) { this._enclosing.mUserPresent = false; this._enclosing.updateRunning(); } else { if (android.content.Intent.ACTION_USER_PRESENT.Equals(action)) { this._enclosing.mUserPresent = true; this._enclosing.updateRunning(false); } } }