Example #1
0
  @Override
  public void onCreate(Bundle icicle) {
    ThemeService.applyTheme(this);
    ThemeService.setForceFilterInvert(true);
    super.onCreate(icicle);

    // Set the result to CANCELED.  This will cause the widget host to cancel
    // out of the widget placement if they press the back button.
    setResult(RESULT_CANCELED);

    // Set the view layout resource to use.
    setContentView(R.layout.widget_config_activity);

    setTitle(R.string.WCA_title);

    // Find the widget id from the intent.
    Intent intent = getIntent();
    Bundle extras = intent.getExtras();
    if (extras != null) {
      mAppWidgetId =
          extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);
    }

    // If they gave us an intent without the widget id, just bail.
    if (mAppWidgetId == AppWidgetManager.INVALID_APPWIDGET_ID) {
      finish();
    }

    // set up ui
    adapter = new FilterAdapter(this, getListView(), R.layout.filter_adapter_row, true, true);
    adapter.filterStyle = R.style.TextAppearance_FLA_Filter_Widget;
    setListAdapter(adapter);

    Button button = (Button) findViewById(R.id.ok);
    button.setOnClickListener(mOnClickListener);

    StatisticsService.reportEvent(StatisticsConstants.WIDGET_CONFIG);
  }
Example #2
0
 @Override
 protected void onStop() {
   super.onStop();
   StatisticsService.sessionStop(this);
   ThemeService.setForceFilterInvert(false);
 }