congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
RadioButton.getText
Code IndexAdd Tabnine to your IDE (free)

How to use
getText
method
in
android.widget.RadioButton

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

origin: rengwuxian/RxJavaSamples

@OnCheckedChanged({R.id.searchRb1, R.id.searchRb2, R.id.searchRb3, R.id.searchRb4})
void onTagChecked(RadioButton searchRb, boolean checked) {
  if (checked) {
    unsubscribe();
    adapter.setImages(null);
    swipeRefreshLayout.setRefreshing(true);
    search(searchRb.getText().toString());
  }
}
origin: facebook/facebook-android-sdk

View child = radioGroup.getChildAt(i);
if (child.getId() == checkedId && child instanceof RadioButton) {
  textObj = ((RadioButton)child).getText();
  break;
origin: ukanth/afwall

  @Override
  public void finish() {
    if (mIsCancelled) {
      setResult(RESULT_CANCELED);
    } else {
      RadioGroup group = (RadioGroup) findViewById(R.id.radioProfiles);
      int selectedId = group.getCheckedRadioButtonId();
      RadioButton radioButton = (RadioButton) findViewById(selectedId);
      String action = radioButton.getText().toString();
      final Intent resultIntent = new Intent();
      if (!G.isProfileMigrated()) {
        int idx = group.indexOfChild(radioButton);
        resultIntent.putExtra(com.twofortyfouram.locale.Intent.EXTRA_BUNDLE, PluginBundleManager.generateBundle(getApplicationContext(), idx + "::" + action));
      } else {
        resultIntent.putExtra(com.twofortyfouram.locale.Intent.EXTRA_BUNDLE, PluginBundleManager.generateBundle(getApplicationContext(), selectedId + "::" + action));
      }
      resultIntent.putExtra(com.twofortyfouram.locale.Intent.EXTRA_STRING_BLURB, action);
      setResult(RESULT_OK, resultIntent);
    }
    super.finish();
  }
}
origin: codepath/intro_android_demo

public void toastInputs(View v) {
  int selected = rdgVal.getCheckedRadioButtonId();
  RadioButton b = (RadioButton) findViewById(selected);
  
  String text = etVal.getText() + " | " + chkVal.isChecked() + " | " + b.getText();
  Toast.makeText(this, text, Toast.LENGTH_SHORT).show();
}
origin: caichengan/ShoppingCartActivity

  @Override
  public void onClick(View view) {
    RadioButton rbAttribute = (RadioButton) gridView.findViewWithTag("rbAttribute" + currentPositionColor);
      for(int i=0;i<listColorSize;i++){
        RadioButton rbAttributeAll = (RadioButton) gridView.findViewWithTag("rbAttribute" + i);
        rbAttributeAll.setChecked(false);
      }
    rbAttribute.setChecked(true);
    sendBrodcastReceiver(rbAttribute.getText().toString());
    //Toast.makeText(context,rbAttribute.getText(),Toast.LENGTH_SHORT).show();
  }
}
origin: epam/JDI

  @Override
  public void onClick(View v) {
    RadioButton r1 = (RadioButton) getView().findViewById(mLeft.getCheckedRadioButtonId());
    int r1Value = Integer.parseInt(r1.getText().toString());
    RadioButton r2 = (RadioButton) getView().findViewById(mRight.getCheckedRadioButtonId());
    int r2Value = Integer.parseInt(r2.getText().toString());

    mResult.setText(getString(R.string.contact_form_result_format,
        mName.getText(),
        mLastName.getText(),
        mDescr.getText(),
        r1Value + r2Value));
  }
}
origin: FudanSELab/train-ticket

  @Override
  public void onCheckedChanged(RadioGroup group, int checkedId) {
    if (checkedId == rb1.getId()) {
      addpsTv.setText(rb1.getText().toString());
      alertDialog.dismiss();
    } else {
      Toast.makeText(getContext(), "not support", Toast.LENGTH_SHORT).show();
    }
  }
});
origin: nglauber/dominando_android2

  public void verValores(View v) {
    int idRadioSelecionado = radioGroup.getCheckedRadioButtonId();
    RadioButton radio = (RadioButton)findViewById(idRadioSelecionado);
    String habilitado = checkBox.isChecked() ? "Habilitado" : "Desabilitado";
    String valor = "valor: "+ seekBar.getProgress();
    String nome = "nome: "+ spinner.getSelectedItem().toString();
    String opcao = "opcao: "+ radio.getText();
    StringBuilder mensagem = new StringBuilder();
    mensagem.append(habilitado).append("\n")
        .append(valor).append("\n")
        .append(nome).append("\n")
        .append(opcao);
    Toast.makeText(this,
        mensagem.toString(), Toast.LENGTH_SHORT).show();
  }
}
origin: doc-rj/smartcard-reader

private int getType() {
  int selectedId = mType.getCheckedRadioButtonId();
  RadioButton radioBtn = (RadioButton) findViewById(selectedId);
  return radioBtn.getText().toString()
      .equals(getString(R.string.radio_payment)) ? SmartcardApp.TYPE_PAYMENT
      : SmartcardApp.TYPE_OTHER;
}
origin: microbit-foundation/microbit-blue

  public void onRadioButtonClicked(View view) {
    // Is the button now checked?
    boolean checked = ((RadioButton) view).isChecked();
    Settings settings = Settings.getInstance();
    short ap = Short.parseShort(((RadioButton) view).getText().toString());
    settings.setMagnetometer_period(ap);
  }
}
origin: microbit-foundation/microbit-blue

  public void onRadioButtonClicked(View view) {
    // Is the button now checked?
    boolean checked = ((RadioButton) view).isChecked();
    Settings settings = Settings.getInstance();
    short ap = Short.parseShort(((RadioButton) view).getText().toString());
    settings.setAccelerometer_period(ap);
  }
}
origin: microbit-foundation/microbit-blue

  public void onRadioButtonClicked(View view) {
    // Is the button now checked?
    boolean checked = ((RadioButton) view).isChecked();
    Settings settings = Settings.getInstance();
    short ap = Short.parseShort(((RadioButton) view).getText().toString());
    settings.setMagnetometer_period(ap);
  }
}
origin: Null-Ouwenjie/zhizhihu

  @Override
  public void onCheckedChanged(RadioGroup group, int checkedId) {
    for (int i = 0; i < group.getChildCount(); i++) {
      RadioButton rb = (RadioButton) group.getChildAt(i);
      if (rb.getId() == checkedId) {
        type[0] = rb.getText().toString();
      }
    }
  }
});
origin: AmazMod/AmazMod

  @Override
  public void onCheckedChanged(RadioGroup group, int checkedId) {
    int childCount = group.getChildCount();
    for (int x = 0; x < childCount; x++) {
      RadioButton btn = (RadioButton) group.getChildAt(x);
      if (btn.getId() == checkedId) {
        selectedIME = inputMethodInfos.get(x).getId();
        Log.i(Constants.TAG,"InputMethodActivity selected RadioButton: " + btn.getText().toString() + " x: " + x);
        runCommand("adb shell ime enable " + selectedIME + ";ime set " + selectedIME + ";exit");
      }
    }
  }
});
origin: angcyo/FlowRadioGroup

/**
 * 获取选中按钮的文本,未选中 返回 空字符串
 */
public String getCheckedRadioButtonText() {
  if (getCheckedRadioButtonId() == -1) {
    return "";
  }
  return ((RadioButton) findViewById(getCheckedRadioButtonId())).getText().toString();
}
origin: dragona/Android_intro

  @Override
  public void onClick(View v) {
    // retrieve the radio button that was selected
    int radioSelected = radiogroup.getCheckedRadioButtonId();
    // get the text associated with that radioId
    RadioButton selected = (RadioButton) findViewById(radioSelected);
    // Show a toast
    /**
     * See the differences between the two toast below and try to
     * understand
     **/
    // Toast.makeText(getBaseContext(), selected+"",
    // Toast.LENGTH_SHORT).show();
    Toast.makeText(getBaseContext(), selected.getText(),
        Toast.LENGTH_SHORT).show();
  }
});
origin: IdeaTrackerPlus/IdeaTrackerPlus

private void sendEditIdea() {
  String new_text = mIdeaField.getText().toString();
  if (!new_text.equals("")) {
    if (mRadioGroup.getCheckedRadioButtonId() != -1) {
      View radioButton = mRadioGroup.findViewById(mRadioGroup.getCheckedRadioButtonId());
      RadioButton btn = (RadioButton) mRadioGroup.getChildAt(mRadioGroup.indexOfChild(radioButton));
      String selection = (String) btn.getText();
      String new_note = mNoteField.getText().toString();
      boolean new_later = mDoLater.isChecked();
      int new_priority = Integer.parseInt(selection);
      mDbHelper.editEntry(mIdRecycler, new_text, new_note, new_priority, new_later);
    }
    mEditIdeaDialog.dismiss();
  } else {
    mError.setVisibility(View.VISIBLE);
  }
}
origin: vbier/habpanelviewer

String getSelectedUrl() {
  View v = getView();
  if (v != null) {
    final RadioGroup rg = getView().findViewById(R.id.intro_discover_radioGroup);
    int id = rg.getCheckedRadioButtonId();
    final RadioButton rb = getView().findViewById(id);
    if (rb != null) {
      String url = (String) rb.getText();
      if (url.equals(getString(R.string.intro_urlNotFound))) {
        return null;
      }
      return url;
    }
  }
  return null;
}
origin: termux/termux-api

  @Override
  String getResult() {
    int radioIndex = radioGroup.indexOfChild(widgetView.findViewById(radioGroup.getCheckedRadioButtonId()));
    RadioButton radioButton = (RadioButton) radioGroup.getChildAt(radioIndex);
    InputResult.index = radioIndex;
    return (radioButton != null) ? radioButton.getText().toString() : "";
  }
}
origin: Swati4star/Images-to-PDF

  /**
   * To modify theme
   */
  public void setTheme() {
    MaterialDialog.Builder builder = createCustomDialogWithoutContent(mActivity,
        R.string.theme_edit);
    MaterialDialog materialDialog = builder.customView(R.layout.dialog_theme_default, true)
        .onPositive(((dialog, which) -> {
          View view = dialog.getCustomView();
          RadioGroup radioGroup = view.findViewById(R.id.radio_group_themes);
          int selectedId = radioGroup.getCheckedRadioButtonId();
          RadioButton radioButton = view.findViewById(selectedId);
          String themeName = radioButton.getText().toString();
          saveTheme(mActivity, themeName);
          mActivity.recreate();
        }))
        .build();
    RadioGroup radioGroup = materialDialog.getCustomView().findViewById(R.id.radio_group_themes);
    RadioButton rb = (RadioButton) radioGroup.getChildAt(getSelectedThemePosition(mActivity));
    rb.setChecked(true);
    materialDialog.show();
  }
}
android.widgetRadioButtongetText

Popular methods of RadioButton

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

Popular in Java

  • Making http requests using okhttp
  • getSystemService (Context)
  • getSharedPreferences (Context)
  • onCreateOptionsMenu (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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