Search Results

Search found 3 results on 1 pages for 'fxi'.

Page 1/1 | 1 

  • Android visibility issue with checkbox

    - by fxi
    Hi all! I´m using a checkbox in my code that when its checked it makes a textview and a editText visibles, but if I uncheck de checkbox they continue being visible instead of dissapear. Here is the code: final CheckBox save = (CheckBox) findViewById(R.id.checkbox); save.setOnClickListener(new OnClickListener() { public void onClick(View v) { // Perform action on clicks, depending on whether it's now checked if (((CheckBox) v).isChecked()) { nameText.setVisibility(1); editName.setVisibility(1); } else { nameText.setVisibility(0); editName.setVisibility(0); } } }); And part of the xml which is inside an Relative Layout: <LinearLayout android:id="@+id/linearLayout3" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below = "@+id/linearLayout2"> <TextView android:id="@+id/text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/name" android:visibility="invisible"/> <EditText android:id="@+id/name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:visibility="invisible"/> <CheckBox android:id="@+id/checkbox" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/save" /> </LinearLayout> What should i do to make the textView and EditText dissapear when i uncheck the checkbox? Thank you!

    Read the article

  • Android: Dinamically add custom checkboxes to a tableLayout

    - by fxi
    What should i do to use custom checkboxes if i add my checkboxes dinamically on my code? (on the java code not on the xml files). Im following this tutorial http://www.anddev.org/novice-tutorials-f8/tutorial-change-look-of-checkbox-t4553.html, but using it i cant achieve my goal. For example, i have a tableLayout and i want to add a checkbox for each new row i have. Thank you all.

    Read the article

1