check ( )源码实例Demo

android.widget.RadioGroup#check ( )源码实例Demo

下面列出了android.widget.RadioGroup#check ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: ProjectX   文件: WrapLayoutActivity.java
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setSupportActionBar(R.id.wl_toolbar);
    mVContent = findViewById(R.id.wl_wl_content);
    final RadioGroup gravity = findViewById(R.id.wl_rg_gravity);
    final SeekBar horizontal = findViewById(R.id.wl_sb_horizontal);
    final SeekBar vertical = findViewById(R.id.wl_sb_vertical);

    gravity.setOnCheckedChangeListener(this);
    gravity.check(R.id.wl_rb_top);
    horizontal.setOnSeekBarChangeListener(this);
    horizontal.setProgress(15);
    vertical.setOnSeekBarChangeListener(this);
    vertical.setProgress(15);
}
 
@Override public View onCreateView(
      @NonNull LayoutInflater inflater,
      ViewGroup container,
      Bundle savedInstanceState
) {
    View view = super.onCreateView(inflater, container, savedInstanceState);

    noSchedulesCopyLayout = (LinearLayout) view.findViewById(R.id.no_schedules_copy);
    addEventButton = (Version1Button) view.findViewById(R.id.add_event_button);
    dayOfWeekGroup = (RadioGroup) view.findViewById(R.id.day_of_week_radio_group);
    schedulesList = (ListView) view.findViewById(R.id.schedules);

    dayOfWeekGroup.check(R.id.radio_monday);

    TextView noScheduleCopyTitle = (TextView) view.findViewById(R.id.no_schedules_copy_title);
    TextView noSchedulesCopyDesc = (TextView) view.findViewById(R.id.no_schedules_copy_desc);
    noScheduleCopyTitle.setText(getString(R.string.care_no_schedule_header_title));
    noSchedulesCopyDesc.setText(getString(R.string.care_no_schedule_header_desc));

    return view;
}
 
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    // Update ActionBar
    setActionBarTitle(R.string.thermalcamera_tab_title);

    // UI
    mUartWaitingTextView = view.findViewById(R.id.uartWaitingTextView);
    RadioGroup colorModeRadioGroup = view.findViewById(R.id.colorModeRadioGroup);
    colorModeRadioGroup.check(mIsColorEnabled ? R.id.colorModeColorButton : R.id.colorModeMonochromeButton);
    colorModeRadioGroup.setOnCheckedChangeListener((radioGroup, i) -> {
        mIsColorEnabled = i == R.id.colorModeColorButton;
        mThermalScaleView.updateGradient();
    });

    RadioGroup magnificationRadioGroup = view.findViewById(R.id.magnificationRadioGroup);
    magnificationRadioGroup.check(mIsFilterEnabled ? R.id.magnificationFilteredButton : R.id.magnificationPixelatedButton);
    magnificationRadioGroup.setOnCheckedChangeListener((radioGroup, i) -> mIsFilterEnabled = i == R.id.magnificationFilteredButton);

    mCameraImageView = view.findViewById(R.id.cameraImageView);
    mLowerTempTextView = view.findViewById(R.id.lowerTempTextView);
    mUpperTempTextView = view.findViewById(R.id.upperTempTextView);
    mThermalScaleView = view.findViewById(R.id.thermalScaleView);
    mThermalScaleView.setThermalCameraFragment(this);

    // Setup
    Context context = getContext();
    if (context != null) {
        mUartDataManager = new UartDataManager(context, this, true);
        setupUart();
    }
}
 
源代码4 项目: android-auto-call-recorder   文件: SortDialog.java
private void checkArrangeRadioGroup(RadioGroup group, String arrange) {
    switch (arrange) {
        case " DESC":
            group.check(R.id.rb_arrange_desc);
            break;
        case " ASC":
            group.check(R.id.rb_arrange_asc);
            break;
    }
}
 
源代码5 项目: HomeApplianceMall   文件: MainActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    this.requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.activity_main);
    viewPager = (ViewPager) findViewById(R.id.ViewPager_main);
    radioGroup = (RadioGroup) findViewById(R.id.RadioGroup_main);
    application = (MyApplication)getApplication();

    //viewPage
    List<Fragment> fragmentList = new ArrayList<>();
    HomeFragment homeFragment = new HomeFragment();
    SearchFragment searchFragment = new SearchFragment();
    ClassifyFragment classifyFragment = new ClassifyFragment();
    ShoppingCarFragment shoppingCarFragment = new ShoppingCarFragment();
    OrderFragment orderFragment = new OrderFragment();
    MyFragment myFragment = new MyFragment();
    fragmentList.add(homeFragment);
    fragmentList.add(searchFragment);
    fragmentList.add(classifyFragment);
    fragmentList.add(shoppingCarFragment);
    fragmentList.add(orderFragment);
    fragmentList.add(myFragment);
    application.setViewPager(viewPager);
    viewPager.setAdapter(new MyFragmentPagerAdapter(getSupportFragmentManager(),fragmentList));
    viewPager.setCurrentItem(0);
    viewPager.setOnPageChangeListener(new MyPageLister());

    //
    radioGroup.setOnCheckedChangeListener(new MyRadionGroupListen());
    radioGroup.check(R.id.radioButton_main_home);
    //
}
 
private void setWifiStatus(Bundle savedInstanceState, View root) {
    EditText ssidText = (EditText) root.findViewById(R.id.inputSSID);
    EditText passwordText = (EditText) root.findViewById(R.id.inputPassword);
    RadioGroup radioGroup = (RadioGroup) root.findViewById(R.id.radioGroupSecurity);
    
    int typeId = -1;
    if (savedInstanceState != null) {
        ssidText.setText(savedInstanceState.getString(KEY_SSID));
        passwordText.setText(savedInstanceState.getString(KEY_PASS));
        typeId = savedInstanceState.getInt(KEY_TYPE);
    } else {
        
        IRKitSettingActivity a = (IRKitSettingActivity) getActivity();
        String ssid = a.getSSID();
        if (ssid == null) {
            ssid = WiFiUtil.getCurrentSSID(a);
        }
        
        ssidText.setText(ssid);
        passwordText.setText(a.getPassword());
        WiFiSecurityType type = a.getSecType();
        switch (type) {
        case NONE:
            typeId = R.id.radioButton1;
            break;
        case WEP:
            typeId = R.id.radioButton2;
            break;
        case WPA2:
        default:
            typeId = R.id.radioButton3;
            break;
        }
    }
    radioGroup.check(typeId);
}
 
源代码7 项目: zhizhihu   文件: FeedbackActivity.java
@NonNull
private FrameLayout createRadioGroupLayout(final String[] typeList, RadioGroup.OnCheckedChangeListener listener) {
    final List<RadioButton> rbList = new ArrayList<>();
    final RadioGroup radioGroup = new RadioGroup(this);
    radioGroup.setPadding(24, 24, 24, 24);
    for (int i = 0; i < typeList.length; i++) {
        RadioButton rb = new RadioButton(this);
        rb.setText(typeList[i]);
        rbList.add(rb);
        radioGroup.addView(rb);
    }
    String curType = mFeedbackTypeTxt.getText().toString();
    for (RadioButton btn : rbList) {
        if (btn.getText().toString().equals(curType)) {
            radioGroup.check(btn.getId());
        }
    }
    radioGroup.setOnCheckedChangeListener(listener);
    FrameLayout frameLayout = new FrameLayout(this);
    FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.MATCH_PARENT);
    lp.leftMargin = DimenUtil.dip2px(this, 24);
    lp.rightMargin = lp.leftMargin;
    frameLayout.addView(radioGroup, lp);
    return frameLayout;
}
 
源代码8 项目: fab   文件: FABActivity.java
private void initButtonTypeRadioGroup() {
	buttonTypeRadioGroup = (RadioGroup) findViewById(R.id.fab_activity_radiogroup_button_type);
	switch (actionButton.getType()) {
		case DEFAULT:
			buttonTypeRadioGroup.check(R.id.fab_activity_radiobutton_default);
			break;
		case MINI:
			buttonTypeRadioGroup.check(R.id.fab_activity_radiobutton_mini);
			break;
		case BIG:
               buttonTypeRadioGroup.check(R.id.fab_activity_radiobutton_big);
               break;
	}
	buttonTypeRadioGroup.setOnCheckedChangeListener(new ButtonTypeChangeListener());
}
 
源代码9 项目: WrapLayout   文件: WrapLayoutActivity.java
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_wraplayout);
    Toolbar mToolbar = findViewById(R.id.wly_toolbar);
    if (mToolbar != null) {
        setSupportActionBar(mToolbar);
        mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                onBackPressed();
            }
        });
        if (getSupportActionBar() != null) {
            getSupportActionBar().setDisplayHomeAsUpEnabled(false);
        }
    }
    lytWrap = findViewById(R.id.wly_lyt_warp);
    final RadioGroup rgGravity = findViewById(R.id.wly_rg_gravity);
    rgGravity.setOnCheckedChangeListener(this);
    rgGravity.check(R.id.wly_rb_top);
    final SeekBar sbHorizontal = findViewById(R.id.wly_sb_horizontal);
    sbHorizontal.setOnSeekBarChangeListener(this);
    sbHorizontal.setProgress(15);
    final SeekBar sbVertical = findViewById(R.id.wly_sb_vertical);
    sbVertical.setOnSeekBarChangeListener(this);
    sbVertical.setProgress(15);
}
 
源代码10 项目: PocketMaps   文件: Dialog.java
public static void showUnitTypeSelector(Activity activity)
{
  AlertDialog.Builder builder1 = new AlertDialog.Builder(activity);
  builder1.setTitle(R.string.units);
  builder1.setCancelable(true);
  
  final RadioButton rb1 = new RadioButton(activity.getBaseContext());
  rb1.setText(R.string.units_metric);

  final RadioButton rb2 = new RadioButton(activity.getBaseContext());
  rb2.setText(R.string.units_imperal);
  
  final RadioGroup rg = new RadioGroup(activity.getBaseContext());
  rg.addView(rb1);
  rg.addView(rb2);
  rg.check(Variable.getVariable().isImperalUnit() ? rb2.getId() : rb1.getId());
  
  builder1.setView(rg);
  OnClickListener listener = new OnClickListener()
  {
    @Override
    public void onClick(DialogInterface dialog, int buttonNr)
    {
      Variable.getVariable().setImperalUnit(rb2.isChecked());
      Variable.getVariable().saveVariables(Variable.VarType.Base);
    }
  };
  builder1.setPositiveButton(R.string.ok, listener);
  AlertDialog alert11 = builder1.create();
  alert11.show();
}
 
源代码11 项目: xDrip-plus   文件: NewSensorLocation.java
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_new_sensor_location);
    button = (Button)findViewById(R.id.saveSensorLocation);
    buttonCancel = (Button)findViewById(R.id.saveSensorLocationCancel);
    sensor_location_other = (EditText) findViewById(R.id.edit_sensor_location);
    sensor_location_other.setEnabled(false);
    DontAskAgain = (CheckBox)findViewById(R.id.sensorLocationDontAskAgain);
    radioGroup = (RadioGroup) findViewById(R.id.myRadioGroup);
    addListenerOnButton();

    locations = new LinkedList<Location>();

    locations.add(new Location("I don't wish to share", PRIVATE_ID));
    locations.add(new Location("Upper arm", 1));
    locations.add(new Location("Thigh", 2));
    locations.add(new Location("Belly (abdomen)", 3));
    locations.add(new Location("Lower back", 4));
    locations.add(new Location("Buttocks", 5));
    locations.add(new Location("Other", OTHER_ID));

    for(Location location : locations) {
        AddButton(location.location, location.location_id);
    }
    radioGroup.check(PRIVATE_ID);

}
 
/**
 * 过滤条件的item
 */
public View getForumFilterItem(int position, View convertView) {
    if (convertView == null) {
        convertView = View.inflate(context, R.layout.item_forum_filter_recomm, null);
    }
    RadioGroup group = ViewHolder.get(convertView, R.id.radio);

    int index = getHomePageIndex(position);
    final Recommend recommend = homePage.get(index).getRecommend();
    ArrayList<ThreadConfig> threadConfigItems = recommend.getThreadConfigs();

    int[] ids = {R.id.radioButton1, R.id.radioButton2, R.id.radioButton3, R.id.radioButton4};
    group.check(ids[recommend.getForumFilterSelectIndex()]);

    for (int i = 0; i < ids.length; i++) {
        RadioButton radioButton = ViewHolder.get(convertView, ids[i]);
        if (threadConfigItems != null && i < threadConfigItems.size()) {
            ThreadConfig item = threadConfigItems.get(i);
            radioButton.setVisibility(View.VISIBLE);
            radioButton.setText(getFilterItemTitle(item));
        } else {
            radioButton.setVisibility(View.GONE);
        }
        final int ii = i;
        radioButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                filterItemClick(recommend, ii);
            }
        });
    }
    return convertView;
}
 
/** Set up interpolation */
private void setUpBottomSheetInterpolation(View view) {
  RadioGroup interpolationGroup = view.findViewById(R.id.interpolation_radio_group);
  ViewGroup customContainer = view.findViewById(R.id.custom_curve_container);
  if (interpolationGroup != null && customContainer != null) {

    setTextInputClearOnTextChanged(view.findViewById(R.id.x1_text_input_layout));
    setTextInputClearOnTextChanged(view.findViewById(R.id.x2_text_input_layout));
    setTextInputClearOnTextChanged(view.findViewById(R.id.y1_text_input_layout));
    setTextInputClearOnTextChanged(view.findViewById(R.id.y2_text_input_layout));

    // Check the correct current radio button and fill in custom bezier fields if applicable.
    if (interpolator instanceof FastOutSlowInInterpolator) {
      interpolationGroup.check(R.id.radio_fast_out_slow_in);
    } else {
      interpolationGroup.check(R.id.radio_custom);
      CustomCubicBezier currentInterp = (CustomCubicBezier) interpolator;
      setTextFloat(view.findViewById(R.id.x1_edit_text), currentInterp.controlX1);
      setTextFloat(view.findViewById(R.id.y1_edit_text), currentInterp.controlY1);
      setTextFloat(view.findViewById(R.id.x2_edit_text), currentInterp.controlX2);
      setTextFloat(view.findViewById(R.id.y2_edit_text), currentInterp.controlY2);
    }

    // Enable/disable custom bezier fields depending on initial checked radio button.
    setViewGroupDescendantsEnabled(
        customContainer, interpolationGroup.getCheckedRadioButtonId() == R.id.radio_custom);

    // Watch for any changes to the selected radio button and update custom bezier enabled state.
    // The custom bezier values will be captured when the configuration is applied.
    interpolationGroup.setOnCheckedChangeListener(
        (group, checkedId) ->
            setViewGroupDescendantsEnabled(customContainer, checkedId == R.id.radio_custom));
  }
}
 
/**
 * 过滤条件的item
 */
public View getForumFilterItem(int position, View convertView) {
    if (convertView == null) {
        convertView = View.inflate(context, R.layout.item_forum_filter_recomm, null);
    }
    RadioGroup group = ViewHolder.get(convertView, R.id.radio);

    int index = getHomePageIndex(position);
    final Recommend recommend = homePage.get(index).getRecommend();
    ArrayList<ThreadConfig> threadConfigItems = recommend.getThreadConfigs();

    int[] ids = {R.id.radioButton1, R.id.radioButton2, R.id.radioButton3, R.id.radioButton4};
    group.check(ids[recommend.getForumFilterSelectIndex()]);

    for (int i = 0; i < ids.length; i++) {
        RadioButton radioButton = ViewHolder.get(convertView, ids[i]);
        if (threadConfigItems != null && i < threadConfigItems.size()) {
            ThreadConfig item = threadConfigItems.get(i);
            radioButton.setVisibility(View.VISIBLE);
            radioButton.setText(getFilterItemTitle(item));
        } else {
            radioButton.setVisibility(View.GONE);
        }
        final int ii = i;
        radioButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                filterItemClick(recommend, ii);
            }
        });
    }
    return convertView;
}
 
/**
 * 过滤条件的item
 */
public View getForumFilterItem(int position, View convertView) {
    if (convertView == null) {
        convertView = View.inflate(context, R.layout.item_forum_filter_recomm, null);
    }
    RadioGroup group = ViewHolder.get(convertView, R.id.radio);
    //group.getLayoutParams().height=(int)context.getResources().getDimension(R.dimen.height_default);

    int[] ids = {R.id.radioButton1, R.id.radioButton2, R.id.radioButton3, R.id.radioButton4};
    group.check(ids[forumFilterSelectIndex]);
    for (int i = 0; i < ids.length; i++) {
        RadioButton radioButton = ViewHolder.get(convertView, ids[i]);
        final int index = i;
        radioButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (forumFilterSelectIndex == index) {
                    return;
                }
                forumFilterSelectIndex = index;
                if (doSomeThing != null) {
                    doSomeThing.execute(forumFilterSelectIndex);
                }
            }
        });
    }
    return convertView;
}
 
源代码16 项目: xDrip-Experimental   文件: NewSensorLocation.java
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_new_sensor_location);
    button = (Button)findViewById(R.id.saveSensorLocation);
    buttonCancel = (Button)findViewById(R.id.saveSensorLocationCancel);
    sensor_location_other = (EditText) findViewById(R.id.edit_sensor_location);
    sensor_location_other.setEnabled(false);
    DontAskAgain = (CheckBox)findViewById(R.id.sensorLocationDontAskAgain);
    radioGroup = (RadioGroup) findViewById(R.id.myRadioGroup);
    addListenerOnButton();

    locations = new LinkedList<Location>();

    locations.add(new Location("I don't wish to share", PRIVATE_ID));
    locations.add(new Location("Upper arm", 1));
    locations.add(new Location("Thigh", 2));
    locations.add(new Location("Belly (abdomen)", 3));
    locations.add(new Location("Lower back", 4));
    locations.add(new Location("Buttocks", 5));
    locations.add(new Location("Other", OTHER_ID));

    for(Location location : locations) {
        AddButton(location.location, location.location_id);
    }
    radioGroup.check(PRIVATE_ID);

}
 
源代码17 项目: Dashchan   文件: ReencodingDialog.java
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
	Context context = getActivity();
	qualityForm = new SeekBarForm(false);
	qualityForm.setConfiguration(1, 100, 1, 1);
	qualityForm.setValueFormat(getString(R.string.text_quality_format));
	qualityForm.setCurrentValue(savedInstanceState != null ? savedInstanceState.getInt(EXTRA_QUALITY) : 100);
	reduceForm = new SeekBarForm(false);
	reduceForm.setConfiguration(1, 8, 1, 1);
	reduceForm.setValueFormat(getString(R.string.text_reduce_format));
	reduceForm.setCurrentValue(savedInstanceState != null ? savedInstanceState.getInt(EXTRA_REDUCE) : 1);
	int padding = getResources().getDimensionPixelSize(R.dimen.dialog_padding_view);
	View qualityView = qualityForm.inflate(context);
	qualityForm.getSeekBar().setSaveEnabled(false);
	qualityView.setPadding(qualityView.getPaddingLeft(), 0, qualityView.getPaddingRight(), padding / 2);
	View reduceView = reduceForm.inflate(context);
	reduceForm.getSeekBar().setSaveEnabled(false);
	reduceView.setPadding(reduceView.getPaddingLeft(), 0, reduceView.getPaddingRight(),
			reduceView.getPaddingBottom());
	radioGroup = new RadioGroup(context);
	radioGroup.setOrientation(RadioGroup.VERTICAL);
	radioGroup.setPadding(padding, padding, padding, padding / 2);
	radioGroup.setOnCheckedChangeListener(this);
	for (int i = 0; i < OPTIONS.length; i++) {
		RadioButton radioButton = new RadioButton(context);
		radioButton.setText(OPTIONS[i]);
		radioButton.setId(IDS[i]);
		radioGroup.addView(radioButton);
	}
	radioGroup.check(IDS[0]);
	LinearLayout linearLayout = new LinearLayout(context);
	linearLayout.setOrientation(LinearLayout.VERTICAL);
	FrameLayout qualityLayout = new FrameLayout(context);
	qualityLayout.setId(android.R.id.text1);
	qualityLayout.addView(qualityView);
	FrameLayout reduceLayout = new FrameLayout(context);
	reduceLayout.setId(android.R.id.text2);
	reduceLayout.addView(reduceView);
	linearLayout.addView(radioGroup, LinearLayout.LayoutParams.MATCH_PARENT,
			LinearLayout.LayoutParams.WRAP_CONTENT);
	linearLayout.addView(qualityLayout, LinearLayout.LayoutParams.MATCH_PARENT,
			LinearLayout.LayoutParams.WRAP_CONTENT);
	linearLayout.addView(reduceLayout, LinearLayout.LayoutParams.MATCH_PARENT,
			LinearLayout.LayoutParams.WRAP_CONTENT);
	ScrollView scrollView = new ScrollView(context);
	scrollView.addView(linearLayout, ScrollView.LayoutParams.MATCH_PARENT,
			ScrollView.LayoutParams.WRAP_CONTENT);
	return new AlertDialog.Builder(context).setTitle(R.string.text_reencode_image)
			.setView(scrollView).setNegativeButton(android.R.string.cancel, null)
			.setPositiveButton(android.R.string.ok, this).create();
}
 
源代码18 项目: fab   文件: FABActivity.java
private void initStrokeColorRadioGroup() {
	strokeColorRadioGroup = (RadioGroup) findViewById(R.id.fab_activity_radiogroup_stroke);
	populateColorsRadioGroup(strokeColorRadioGroup, RadioButtons.STROKE_COLORS);
	strokeColorRadioGroup.setOnCheckedChangeListener(new ColorChangeListener());
	strokeColorRadioGroup.check(strokeColorRadioGroup.getChildAt(0).getId());
}
 
源代码19 项目: fab   文件: FABActivity.java
private void initButtonColorsRadioGroup() {
	buttonColorsRadioGroup = (RadioGroup) findViewById(R.id.fab_activity_radiogroup_colors);
	populateColorsRadioGroup(buttonColorsRadioGroup, RadioButtons.COLORS);
	buttonColorsRadioGroup.setOnCheckedChangeListener(new ColorChangeListener());
	buttonColorsRadioGroup.check(buttonColorsRadioGroup.getChildAt(0).getId());
}
 
源代码20 项目: mytracks   文件: ExportDialogFragment.java
@Override
protected Dialog createDialog() {
  FragmentActivity fragmentActivity = getActivity();
  accounts = AccountManager.get(fragmentActivity).getAccountsByType(Constants.ACCOUNT_TYPE);

  // Get views
  View view = fragmentActivity.getLayoutInflater().inflate(R.layout.export, null);
  exportTypeOptions = (Spinner) view.findViewById(R.id.export_type_options);
  exportGoogleMapsOptions = (RadioGroup) view.findViewById(R.id.export_google_maps_options);
  exportGoogleFusionTablesOptions = (RadioGroup) view.findViewById(
      R.id.export_google_fusion_tables_options);
  exportExternalStorageOptions = (RadioGroup) view.findViewById(
      R.id.export_external_storage_options);
  accountSpinner = (Spinner) view.findViewById(R.id.export_account);
  
  // Setup exportTypeOptions
  setupExportTypeOptions(fragmentActivity);

  // Setup exportGoogleMapsOptions
  boolean exportGoogleMapsPublic = PreferencesUtils.getBoolean(fragmentActivity,
      R.string.export_google_maps_public_key, PreferencesUtils.EXPORT_GOOGLE_MAPS_PUBLIC_DEFAULT);
  exportGoogleMapsOptions.check(
      exportGoogleMapsPublic ? R.id.export_google_maps_public : R.id.export_google_maps_unlisted);

  // Setup exportGoogleFusionTablesOptions
  boolean exportGoogleFusionTablesPublic = PreferencesUtils.getBoolean(fragmentActivity,
      R.string.export_google_fusion_tables_public_key,
      PreferencesUtils.EXPORT_GOOGLE_FUSION_TABLES_PUBLIC_DEFAULT);
  exportGoogleFusionTablesOptions.check(
      exportGoogleFusionTablesPublic ? R.id.export_google_fusion_tables_public
          : R.id.export_google_fusion_tables_private);

  // Setup exportExternalStorageOptions
  setExternalStorageOption(
      (RadioButton) view.findViewById(R.id.export_external_storage_kml), TrackFileFormat.KML);
  setExternalStorageOption(
      (RadioButton) view.findViewById(R.id.export_external_storage_gpx), TrackFileFormat.GPX);
  setExternalStorageOption(
      (RadioButton) view.findViewById(R.id.export_external_storage_csv), TrackFileFormat.CSV);
  setExternalStorageOption(
      (RadioButton) view.findViewById(R.id.export_external_storage_tcx), TrackFileFormat.TCX);
  TrackFileFormat trackFileFormat = TrackFileFormat.valueOf(PreferencesUtils.getString(
      fragmentActivity, R.string.export_external_storage_format_key,
      PreferencesUtils.EXPORT_EXTERNAL_STORAGE_FORMAT_DEFAULT));
  exportExternalStorageOptions.check(getExternalStorageFormatId(trackFileFormat));

  // Setup accountSpinner
  AccountUtils.setupAccountSpinner(fragmentActivity, accountSpinner, accounts);
  
  return new AlertDialog.Builder(fragmentActivity).setNegativeButton(
      R.string.generic_cancel, null)
      .setPositiveButton(R.string.menu_export, new DialogInterface.OnClickListener() {
          @Override
        public void onClick(DialogInterface dialog, int which) {
          FragmentActivity context = getActivity();
          ExportType type = exportTypeOptionsList.get(
              exportTypeOptions.getSelectedItemPosition());
          TrackFileFormat format = null;

          PreferencesUtils.setString(context, R.string.export_type_key, type.name());
          if (type == ExportType.GOOGLE_MAPS) {
            PreferencesUtils.setBoolean(context, R.string.export_google_maps_public_key,
                exportGoogleMapsOptions.getCheckedRadioButtonId()
                == R.id.export_google_maps_public);
          } else if (type == ExportType.GOOGLE_FUSION_TABLES) {
            PreferencesUtils.setBoolean(context, R.string.export_google_fusion_tables_public_key,
                exportGoogleFusionTablesOptions.getCheckedRadioButtonId()
                == R.id.export_google_fusion_tables_public);
          } else if (type == ExportType.EXTERNAL_STORAGE) {
            format = getTrackFileFormat(exportExternalStorageOptions.getCheckedRadioButtonId());
            PreferencesUtils.setString(
                context, R.string.export_external_storage_format_key, format.name());
          }
          Account account;
          if (accounts.length == 0) {
            account = null;
          } else if (accounts.length == 1) {
            account = accounts[0];
          } else {
            account = accounts[accountSpinner.getSelectedItemPosition()];
          }
          AccountUtils.updateShareTrackAccountPreference(context, account);
          caller.onExportDone(type, format, account);
        }
      }).setTitle(R.string.export_title).setView(view).create();
}