TextView tv = (TextView)findViewById(R.id.tv); textMessage = (EditText)findViewById(R.id.textMessage); textMessage.addTextChangedListener(new TextWatcher(){ public void afterTextChanged(Editable s) { tv.setText(String.valueOf(i)); } public void beforeTextChanged(CharSequence s, int start, int count, int after){} public void onTextChanged(CharSequence s, int start, int before, int count){} });
layout in here
<RadioGroup android:id="@+id/segment01" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <RadioButton android:id="@+id/button_two" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:layout_gravity="center|left"/> <RadioButton android:id="@+id/button_two" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center|right" /> </RadioGroup>