How to get checked radio button in list view?

前端 未结 3 675
广开言路
广开言路 2021-02-06 20:17

I want to get checked radio button from list view from list item like below image.

\"enter

3条回答
  •  名媛妹妹
    2021-02-06 20:45

    public void onRadioButtonClick(View v) {
        RadioButton rb = (RadioButton) v;
        Toast.makeText(getApplicationContext(),
        rb.getText(),Toast.LENGTH_SHORT).show();
        View Rg = (View) rb.getParent();
        View LLayout = (View) Rg.getParent();
        TextView txtLvId = (TextView) LLayout.findViewById(R.id.ins_itemid);
        String LvID = txtLvId.getText().toString();
        Toast.makeText(getApplicationContext(), LvID, Toast.LENGTH_LONG).show();
    }
    

提交回复
热议问题