android-checkbox

How to set checkbox border color

人盡茶涼 提交于 2019-12-29 04:29:09
问题 The checkbox border is invisible on white background. I played with different color parameters without success. I need black border of box. Yes, there examples to make custom checkbox. In all drawable examples the normal box is visible inside of new shape. And the drawable shape is narrow without text in android:text="" . But why checkbox does not look okay in usual xml: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/layoutBottom1" android:layout

Android Checkable Menu Item

二次信任 提交于 2019-12-28 03:32:05
问题 I have the following menu layout in my Android app: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/item1" android:titleCondensed="Options" android:title="Highlight Options" android:icon="@android:drawable/ic_menu_preferences" /> <item android:id="@+id/item2" android:titleCondensed="Persist" android:title="Persist" android:icon="@android:drawable/ic_menu_preferences" android:checkable="true" /> </menu> My problem

Onscroll selected checkbox getting unchecked using listiview

≯℡__Kan透↙ 提交于 2019-12-28 03:15:09
问题 In my application i added checkbox with ListView ,and i also gave limitation for checkbox ,user can not select more than 5 checkbox ,but the issue is on scroll my selected checkbox get unchecked following is my snippet code,can any one help me with this public class CustomAdapter extends BaseAdapter { private LayoutInflater inflater = null; Context context; String rup = "\u20B9"; private ArrayList<ModelPooja> listData; boolean checked[]; public CustomAdapterPooja(Context mainActivity,

EditText/Checkbox text/value inside the ListView

烂漫一生 提交于 2019-12-25 03:03:23
问题 I have a ListView and inside that listview , EditText or 'CheckBox' means chekbox for the first 7 rows then Edittext is visible for other rows. Now I want the values of these rows which is clicked inside Checkbox in first 7 rows and 'EditText' text for rest of the rows when Button is clicked. But problem is index for the EditText and Checkbox as it is in ListView .. How can i get value or text of all the row in single button click... public View getView(int position, View convertView,

How do I make my toggle button act like a radio button?

旧时模样 提交于 2019-12-25 02:02:45
问题 I have 2 toggle buttons in my code and I want to change the behavior such that when one is selected the other one is not and vice versa. (want it to work like a radio button ).Any idea on how I can go about it? Here's my java code for the same: public class DashboardManageListFragment extends Fragment implements OnClickListener,OnCheckedChangeListener { public final static String TAG_MANAGE_DASHBOARD_LIST_FRAGMENT = "ManageDashboardListFragment"; public final static String IS_PERSONAL =

How to check all checkboxes in a ListView

情到浓时终转凉″ 提交于 2019-12-23 05:31:02
问题 I have a list, in which each row contains a checkbox and a textview, also I have a button which should check/uncheck all checkboxes in the list, however, I have not been able to achieve this with the checkboxes OUTSIDE of the screen, only with the visibles one. And if I understood well, that happens because items outside of the screens dont exist, they are recycled to create the new rows while scrolling, causing null pointers/out of index errores while trying to check/access the checkboxes

Android listview with editText and checkbox for each element

主宰稳场 提交于 2019-12-20 06:25:54
问题 let's say that i have a list of items and i want to build a form with each of these items. This form consist of two checkboxes and an editText. For example i want to know if each item is present in a warehouse and its quantity. I'm thinking for solving my problem to use a listview where each element of my listview will consist of the name of an item, two checkboxes and an editText. The problem is that the only use of listview i know to present list of elements, i don't how to solve my problem

listview checkbox trouble in android

喜你入骨 提交于 2019-12-20 03:24:20
问题 i have a trouble with listview. i added a checkbox into listview to choose items. my data is coming from sqlite so i use simple cursor adapter. length of my list is aproximatley 250 lines. i am clicking a check box.when i scroll down page (list), checkbox is clicked in every 10 lines.(for example in my screen show 10 lines data when i scroll 11th lines, this row's checkbox had clicked. how can i solve this problem. <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http:/

How to disable checkbox when a limit is reached in android?

北城余情 提交于 2019-12-20 02:35:18
问题 I have 15 CheckBox and I must to stuck user when he checks more than 5. I use the method OnCheckedChangeListener to know if an item is checked, but I don't know how to limit after 5 items selected . See my code below: int lengthBox = 15; int lenghtCount = 0; // inside onCreate method final CheckBox[] checkbox = new CheckBox[lengthBox]; OnCheckedChangeListener checker = new OnCheckedChangeListener(){ @Override public void onCheckedChanged(CompoundButton cb, boolean b) { // How can I improve

Unable to check/uncheck CheckedTextView inside getView

橙三吉。 提交于 2019-12-18 03:09:11
问题 I'm loading phone contacts in a custom ListView. Each row is a checkable LinearLayout containing a CheckedTextView and another TextView. I'm feeding the list view with a custom ArrayAdapter. My problem is that I can't control CheckedTextViews inside getView(). For example when I try the following public View getView(int position, View convertView, ViewGroup parent) { View row = convertView; if(row == null){ row = inflater.inflate(layout, parent, false); } CheckedTextView checkedTextView =