Tabnine Logo
RadioButton.setText
Code IndexAdd Tabnine to your IDE (free)

How to use
setText
method
in
android.widget.RadioButton

Best Java code snippets using android.widget.RadioButton.setText (Showing top 20 results out of 432)

origin: Kaopiz/android-segmented-control

private void addButton(SegmentedGroup group) {
  RadioButton radioButton = (RadioButton) getActivity().getLayoutInflater().inflate(R.layout.radio_button_item, null);
  radioButton.setText("Button " + (group.getChildCount() + 1));
  group.addView(radioButton);
  group.updateBackground();
}
origin: JohnPersano/SuperToasts

for (String string : getArguments().getStringArrayList(ARG_ARRAY)) {
  final RadioButton radioButton = new RadioButton(getActivity());
  radioButton.setText(string);
  radioButton.setId(ViewUtils.generateViewId());
  radioGroup.addView(radioButton);
origin: TeamNewPipe/NewPipe

for (AdapterChoiceItem item : choices) {
  final RadioButton radioButton = (RadioButton) inflater.inflate(R.layout.list_radio_icon_item, null);
  radioButton.setText(item.description);
  radioButton.setCompoundDrawablesWithIntrinsicBounds(item.icon, 0, 0, 0);
  radioButton.setChecked(false);
origin: ac-pm/Inspeckage

RadioButton rdbtn = new RadioButton(view.getContext());
rdbtn.setId(i);
rdbtn.setText(address[i]);
if (h.equals(address[i])) {
  rdbtn.setChecked(true);
origin: ukanth/afwall

button1.setText(name != null && name.length() == 0 ? getString(R.string.defaultProfile) : name);
    RadioButton rdbtn = new RadioButton(this);
    rdbtn.setId(counter++);
    rdbtn.setText(profile);
    profiles.addView(rdbtn);
  button2.setText(name != null && name.length() == 0 ? getString(R.string.profile1) : name);
  name = prefs.getString("profile2", getString(R.string.profile2));
  button3.setText(name != null && name.length() == 0 ? getString(R.string.profile2) : name);
  name = prefs.getString("profile3", getString(R.string.profile3));
  button4.setText(name != null && name.length() == 0 ? getString(R.string.profile3) : name);
      RadioButton rdbtn = new RadioButton(this);
      rdbtn.setId(id.intValue());
      rdbtn.setText(profile);
      profiles.addView(rdbtn);
origin: daquexian/chaoli-forum-for-android-2

@Override
public void setText(SpannableStringBuilder builder) {
  ((RadioButton) this).setText(builder);
}
origin: huangweicai/OkLibDemo

/**
* 小时 选择器 改变 监听
*
* @param timePicker
* @param i
* @param i1
*/
@Override
public void onTimeChanged(TimePicker timePicker, int i, int i1) {
  calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR));
  calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH));
  calendar.set(Calendar.DAY_OF_MONTH, calendar.get(Calendar.DAY_OF_MONTH));
  calendar.set(Calendar.HOUR_OF_DAY, i);
  calendar.set(Calendar.MINUTE, i1);
  timeButton.setText(simpleTimeFormat.format(calendar.getTime()));
}
origin: dsolonenko/financisto

/**
 * Adjust the title based on the credit card's payment day.
 */
private void setLabels() {
  
  Calendar date = new GregorianCalendar(year, month, 1);
     SimpleDateFormat dateFormat = new SimpleDateFormat("MMMMM yyyy");  
  String pd = dateFormat.format(date.getTime()); 
  
  TextView label = (TextView)findViewById(R.id.closing_day_reference_period);
  label.setText(getString(R.string.reference_period)+"\n" + pd);
  
  regularCD.setText(getString(R.string.regular_closing_day)+" ("+regularClosingDay+")");
  
}

origin: huangweicai/OkLibDemo

  /**
  * 日期 选择 器 改变 监听
  *
  * @param datePicker
  * @param i
  * @param i1
  * @param i2
  */
  @Override
  public void onDateChanged(DatePicker datePicker, int i, int i1, int i2) {
    calendar.set(Calendar.YEAR, datePicker.getYear());
    calendar.set(Calendar.MONTH, datePicker.getMonth());
    calendar.set(Calendar.DAY_OF_MONTH, datePicker.getDayOfMonth());
    calendar.set(Calendar.HOUR_OF_DAY, calendar.get(Calendar.HOUR));
    calendar.set(Calendar.MINUTE, calendar.get(Calendar.MINUTE));
    dateButton.setText(simpleDateFormat.format(calendar.getTime()));
//        Log.i("testss", simpleDateFormat.format(calendar.getTime()));
  }

origin: vbier/habpanelviewer

  @Override
  protected void onPostExecute(Void aVoid) {
    tv.setText(R.string.intro_discoveryFinished);
    pbar.setVisibility(View.GONE);
    RadioButton button = new RadioButton(getActivity());
    button.setText(R.string.intro_urlNotFound);
    rg.addView(button);
  }
}.execute((Void) null);
origin: Awent/PhotoPick-Master

@Override
public void onPageSelected(int position) {
  pos = position;
  position++;
  toolbar.setTitle(position + "/" + photos.size());
  if (selectPhotos != null && selectPhotos.contains(photos.get(pos).getPath())) {
    checkbox.setChecked(true);
    if (pos == 1 && selectPhotos.contains(photos.get(pos - 1).getPath())) {
      checkbox.setChecked(true);
    }
  } else {
    checkbox.setChecked(false);
  }
  if (originalPicture) {
    radioButton.setText(getString(R.string.image_size, FileSizeUtil.formatFileSize(photos.get(pos).getSize())));
  }
}
origin: mkulesh/microMathematics

public void onCreate(RadioButton[] rb)
{
  for (int i = 0; i < rb.length; i++)
  {
    rb[i].setText(FileType.values()[i].getDescriptionId());
    rb[i].setChecked(i == fileType.ordinal());
  }
}
origin: Meiqia/MeiqiaSDK-Android

private void initData() {
  try {
    JSONArray choiceArray = new JSONArray(choices);
    for (int i = 0; i < choiceArray.length(); i++) {
      RadioButton radioButton = (RadioButton) getLayoutInflater().inflate(R.layout.mq_item_form_radio_btn, null);
      radioButton.setText(choiceArray.getString(i));
      radioButton.setTag(choiceArray.get(i));
      radioButton.setId(View.NO_ID);
      radioButton.setOnCheckedChangeListener(this);
      MQUtils.tintCompoundButton(radioButton, R.drawable.mq_radio_btn_uncheck, R.drawable.mq_radio_btn_checked);
      radioGroup.addView(radioButton, LinearLayout.LayoutParams.MATCH_PARENT, MQUtils.dip2px(MQCollectInfoActivity.this, 48));
    }
  } catch (JSONException e) {
    rootView.setVisibility(View.GONE);
    e.printStackTrace();
  }
}
origin: heinrichreimer/android-issue-reporter

protected final void setGuestEmailRequired(boolean required) {
  this.emailRequired = required;
  if (required) {
    optionAnonymous.setText(R.string.air_label_use_email);
    ((TextInputLayout) findViewById(R.id.air_inputEmailParent)).setHint(getString(R.string.air_label_email));
  } else {
    optionAnonymous.setText(R.string.air_label_use_guest);
    ((TextInputLayout) findViewById(R.id.air_inputEmailParent)).setHint(getString(R.string.air_label_email_optional));
  }
}
origin: zhaoyang21cn/iLiveSDK_Android_Suixinbo

  private void initMenus(String[] menus){
    RadioGroup.LayoutParams layoutParams = new RadioGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
        ViewGroup.LayoutParams.WRAP_CONTENT);
    layoutParams.setMargins(5, 10, 5, 10);
    rbList = new ArrayList<>();
    for (String menu : menus){
      RadioButton rbMenu = new RadioButton(getContext());
      rbMenu.setText(menu);
      rbList.add(rbMenu);
      rgMain.addView(rbMenu, layoutParams);
    }
  }
}
origin: quaap/LaunchTime

private RadioButton makeRadioButton(RadioGroup baks, final String bk, final boolean item) {
  RadioButton bkb = new RadioButton(this);
  bkb.setText(bk);
  bkb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
    @Override
    public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
      if (b) {
        selectedBackup = bk;
        selected = item;
        Log.d("backuppage", "selected = " + selectedBackup);
        backupSelected(selected);
      }
    }
  });
  baks.addView(bkb);
  return bkb;
}
origin: jamorham/xDrip-plus

private void AddButton(String text, int id) {
  RadioButton newRadioButton = new RadioButton(this);
  newRadioButton.setText(text);
  newRadioButton.setId(id);
  LinearLayout.LayoutParams layoutParams = new RadioGroup.LayoutParams(
      RadioGroup.LayoutParams.WRAP_CONTENT,
      RadioGroup.LayoutParams.WRAP_CONTENT);
  radioGroup.addView(newRadioButton);
}
origin: NightscoutFoundation/xDrip

private void AddButton(String text, int id) {
  RadioButton newRadioButton = new RadioButton(this);
  newRadioButton.setText(text);
  newRadioButton.setId(id);
  LinearLayout.LayoutParams layoutParams = new RadioGroup.LayoutParams(
      RadioGroup.LayoutParams.WRAP_CONTENT,
      RadioGroup.LayoutParams.WRAP_CONTENT);
  radioGroup.addView(newRadioButton);
}
origin: mkulesh/microMathematics

public void onCreate(RadioButton[] rb)
{
  for (int i = 0; i < rb.length; i++)
  {
    final String text = ctx.getString(R.string.dialog_function_selection) + " "
        + Integer.toString(i + 1) + ":";
    rb[i].setText(text);
    final Paint p = functions.get(i).getLineParameters().getPaint();
    final int textWidth = (int) rb[i].getPaint().measureText(text);
    rb[i].setCompoundDrawables(null, null,
        new LineDrawable(p, textWidth, (int) (p.getStrokeWidth() + 4)), null);
    rb[i].setCompoundDrawablePadding(ctx.getResources().getDimensionPixelSize(
        R.dimen.dialog_content_padding));
  }
}
origin: vbier/habpanelviewer

@Override
protected Void doInBackground(Void... voids) {
  mDiscovery.discover(serverUrl -> getActivity().runOnUiThread(() -> {
    RadioButton button = new RadioButton(getActivity());
    button.setText(serverUrl);
    rg.addView(button);
  }));
  return null;
}
android.widgetRadioButtonsetText

Popular methods of RadioButton

  • setChecked
  • isChecked
  • setOnClickListener
  • setOnCheckedChangeListener
  • <init>
  • getId
  • setId
  • getText
  • setEnabled
  • setVisibility
  • setButtonDrawable
  • setTag
  • setButtonDrawable,
  • setTag,
  • setTextColor,
  • setLayoutParams,
  • setBackgroundDrawable,
  • getTag,
  • setBackgroundColor,
  • setTextSize,
  • onDraw

Popular in Java

  • Finding current android device location
  • requestLocationUpdates (LocationManager)
  • runOnUiThread (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Reference (javax.naming)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now