java - Why is onCheckedChanged not responding? -


I have so far following code which allow you to set a price for me to click the toggle button For some reason classified in a radiogram, it seems like on chicade is not called converting. Is it an Apocache for this?

  // onClickListener method which is an interface personal view. Click to create onClickClickClicklist (last integer value) {New view. Click on Click () {@Override Public Zero (see View) {buttonValue = value; Buttonstate = true; Toggle Clicked Button = (Toggleton) View; RadioGroup radio group = (radio group) clicked button .get Paint (); Last text view number = (text view) view.findViewById (R.id.num); radioGroup.setOnCheckedChangeListener (New RadioGroup.OnCheckedChangeListener () {@Override public void onCheckedChanged (RadioGroup group, checkedId int) {switch (checkedId) {case R.id.number_zero: buttonValue = value; num.setText (buttonValue); System.out .println ( "button" value + button value) case R.id.number_one: buttonValue = value; num.setText (buttonValue); System.out.println ( "button" value + button value) case R.id. number_two: button value = value; num.setText (buttonValue); System.out.println ( "button value" + button Whilu) case R.id.n Umber_three: buttonValue = value; num.setText (buttonValue); System. Out.println ("Button Value" + Button Value);} System.out.println ("Check Changed Listener" Is called);}}); For (int i = 0; i & lt; radioGroup.getChildCount (); ++ i) see [nextChild = radioGroup.getChildAt (i); If (! (Next Child Instance of Toggle)) {continue; } If (NextChildkgetId ()! = Click Btnkgetaidi () ||! Button was clicked. The Czech ()) {Toglbattn TB 2 = (Toglbtn) next child; Tb2.setChecked (wrong); }}}}; }  

: Calling:

  zero .setOnClickListener (createClickListener (0)); One.setOnClickListener (createClickListener (1)); Two.setOnClickListener (createClickListener (2)); Do three.setOnClickListener (createClickListener (3))  

Edit:

not be set TextView some reason, the text Has been number

I

  changed from the last text view number = (the text view) to view.findViewById (R.id.num); Num.setText (value);  

to

  num = (TextView) findViewById (R.id.num); Num.setText (Integer.toString (value));  

To create it:

  TextView number;  

A global variable

I used the debugger and num is not null and the value is the number of buttons.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -